HTML2XAML | Utililty to inject HTML into a XAML RichTextBlock | Runtime Evironment library
kandi X-RAY | HTML2XAML Summary
kandi X-RAY | HTML2XAML Summary
This is a UWP class library to inject HTML into a RichTextBlock easily.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of HTML2XAML
HTML2XAML Key Features
HTML2XAML Examples and Code Snippets
Community Discussions
Trending Discussions on HTML2XAML
QUESTION
I want to convert HTML to RichTextBlock in UWP. I found some answers in stackoverflow tried the code in following link
But when I try to bind html property in richtextblock controls it gives error saying The name "Properties" does not exist in the namespace "using XAMLHtml"
I included following code to convert HTML to RTF in XAMLHtml.cs file
...ANSWER
Answered 2020-Feb-12 at 09:14This project is class lib for UWP platform. please download the full project and refer it.
I check the code the class name is HtmlProperties
but not Properties
, so you need edit your xaml code like the following
QUESTION
I am currently working on Windows 10 UWP project. I am getting a HTML file from the server and I want show this in UWP app.I want to use RichTextBlock instead of web view.I tried github code here which has used Html2Xaml library but I'm getting error when I try to bind data to RichTextBlock.I found this but it only contains to convert rtf to html
I just simply want to convert html to the RichTextBlock and show the html file in UWP app.Please, someone, suggest how to achieve my requirement with RichTextBlock
...ANSWER
Answered 2020-Feb-07 at 01:13The best way to display Html is to use WebView
, but if you want to convert it into text that RichTextBlock
can display, this may be more complicated.
Let me briefly explain the idea:
1. Load Html and turn it into a parseable entity.
In the nuget package manager, you can find some related Html parsing packages, search Html
to download the most popular package.
2. Parse the Html document and generate the corresponding Block
or Inline
based on the tag type by recursion
The recursive method is to check whether the Tag
currently being parsed has children, and if so, repeat the parse method.
3. Write conversion methods for various tags
RichTextBlock
cannot be converted into corresponding styled text according to Html tags, so this needs to be written by ourselves.
Take ...
as an example, this is a bold inline text. You can use this method when converting:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install HTML2XAML
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page