Parse Markdowns in TextBlock in UWP .NET C# - c#

I Want to parse a string which contains markdown and I also want to display the parsed markdown in the TextBlock of UWP App.
Some of the markdowns I want to parse :-
__bold__
_italic_
~!spoiler!~ - Here the text "spoiler" will be hidden and when I click it, it will show up the text.
youtube("https://youtu.be/aUnak1") - This will embed a youtube video.
[hyperlink](https://google.com) - Hyperlink.
Anyone has any idea how to achieve this in UWP App. If Someone knows please help me.
Thanks in Advnace...

You can take a look at the Windows Community Toolkit
it actually features a MarkdownTextBlock:
https://github.com/CommunityToolkit/WindowsCommunityToolkit/tree/rel/7.1.0/Microsoft.Toolkit.Uwp.UI.Controls.Markdown/
You can also take a look at the Windows Community Toolkit sample app:
https://www.microsoft.com/en-us/p/windows-community-toolkit-sample-app/9nblggh4tlcq

Related

how to capture freehand writing in xamarin forms

I am working on an app to get free hand texts from a user and save as text file using xamarin forms but i am not quite getting any api or nugget or library for that any help will be appreciated
Check out the SignaturePad component.
Check out this guide: link
You can also check out this implementation of the signature pad here: link

Launch printer from the app

I am working on a UWP project and I am trying to print an image from my app. I have tried using the printing sample from microsoft but it's utterly confusing and it's stuck on an error I don't have the time or the patience to solve. Is there a way to launch printer programmatically as if I right clicked the item and chose print?
Diederik Krols did a very detailed blog post about printing, it's for WinRT but should mostly work for UWP too ( except for margins and layout because that has changed in Win10 UWP )
So take a look at this sample http://blogs.u2u.be/diederik/post/2013/01/20/Printing-from-MVVM-XAML-Windows-8-Store-apps.aspx
It's still a lot of work though...
You shoud use RawPrinterHelper class Please see the example in the following link
https://support.microsoft.com/en-us/kb/322091

C# Chat - how to show messages decently?

im making a Chat client and server.. everything was for the best, thread, connections, all ok.
But now my C# program got a problem..
..i searched for hours and days without solution
Its my problem:
I need to replace the (classic) textbox for reading, with something that supports color, smile, font, maybe interactive features.
RichTextBox? No GIF support or interactive items
i like fastcoloredtextbox but cant change font or font-size (it's possible but does not work well) btw not right for me
I would use a Browser, which allows me to use html, css and javascript, so to solve all my problems..
Why i cant?
Geckofx? Don't work [!?] :|
Standard WebBrowser suck. I had Windows 8, but still IE9 (wtf?).
Awesomium? It's ok but can't modify the document...
should i create a blank html page and insert all through javascript?
any solution? what do you suggest?
[it's a desktop app, i'm using vs2010]
thanks
EDIT: Got a solution.
WebSockets is the way..! :3
I found a few links that could be useful if you want to use rtf:
http://www.codeproject.com/Articles/4544/Insert-Plain-Text-and-Images-into-RichTextBox-at-R
http://social.msdn.microsoft.com/forums/en-US/winforms/thread/fe9bfcb7-b226-4a54-9882-11c699bf1cb4/
How can I make a hyperlink work in a RichTextBox?
C# / WPF: Richtextbox: Find all Images
But there are many possible answers to this question, so its really up to you how you want to display the messages.

Simplest DIY datepicker and timepicker for a Metro app (c# & XAML)

I am working on a Metro app, and as far as I know there is no datepicker control available ATM. In my app the user is working with dates, and I am looking for a way to make this less painfull for the user.
What would be the best way to go about it? Anybody have a nice custom control sample they would like to share?
I have the same problem with graphs, but I am hoping to get an access code to Teleriks preview to their Win8 controls, but I couldnt see any date or timepickers there.
Currently there is not a WinRT DatePicker as explained in this MSDN answer. Tim Heuer and some are working on some simple WinRT components. You can find their work, called Callisto, on Github. A DatePicker looks to be next on the list, but they could always use help as well. The best place to start would be the Windows Phone 7 DatePicker. You can download the source from Codeplex.
Telerik has now released the beta of their windows 8 controls, one of them being a datepicker! Problem solved :)

How to make text of image editor in website? platform .net

I show many editors in websites like stackoverflow and w3school.
i want to develop that type of editor in my website.
tell me how can i develop that text editor. where i can put any language code.
and also formatting it like stackoverflow.
and can i put picture directly pasted in that editor .. if i want to show any
screen shot of any coding or design.
free editors required.
thanks for any help.
If you want to use an editor that is capable of adding an image to editable text such as the one here on SO, look into CKEditor or TinyMCE. If you want to develop your own, TinyMCE is open source and would make a good start.

Categories