Formatting text in RichTextBlock in FlipView

I have flipView in sample itemDetailPage and I have text in string which has html tags (bold, italics). I want this string shows in richTextBlock in flipView but I don´t know how. I was searching for converters between HTML and XAML and there aren´t working with WinRT. I was looking into source codes and searching for answers and I can convert my html string to xaml string. It looks like

<FlowDocument xml:space="preserve" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"><Paragraph>Start<Run>i--</Run> something <Run>i++</Run> end of paragraph.</Paragraph><Paragraph>nn</Paragraph><Paragraph>Another paragraph <Run>anything</Run>. And ending.</Paragraph><Paragraph>nn</Paragraph></FlowDocument>

But when I this bind to Text property of RichTextBlock it just shows as text without formatting. So how can I format text in RichTextBlock? I know it´s possible to do this with adding textblocks but in FlipView I don´t how access to richTextBlock. I want to use RichTextBlock and I don´t want to change it for WebView or some WebControls (I like column sorting in RichTextBlock).


Yeah, this problem has been ongoing. Vincent H had a good start with an xslt conversion. I recently took his start and expanded it using the Html Agility Pack. My main impetus was dealing with really badly formed Html and I think I got something at least minimally useful...

链接地址: http://www.djcxy.com/p/67380.html

上一篇: UWP RichTextBlock本地化

下一篇: 在FlipView中格式化RichTextBlock中的文本