I have a simple HTML (copy/paste from printable version of some Wikipedia page) and I wanna show it in my app.
Is there any way to convert it to a more native XAML look rather than just showing the whole page in a WebView?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use the HTML Agility Pack to parse the HTML and format a TextBlock or RichTextBlock. You can check out the RichTextBlockExtensions.LinkedHtmlFragment I wrote for a sample of how you might go about adding some text with links to a RichTextBlock, but this only supports plain text with some basic anchor tags. Anything more would require more work and I haven’t come across any open source library that would do it for you, since you would likely need to have custom styling for a limited set of pages. Otherwise – writing a generic HTML to XAML converter is probably an effort similar to implementing a new web browser.