Ghost1372

everything can be handy

RichTextFormatterHelper

Formats a TextBlock/RichTextBlock using HTML-like formatting codes.

Supported Tags

Name
br
b
u
i
font size=’size’
font color=’hexcolor’
font bgcolor=’hexcolor’

To combine both foreground and background colors, use font colors=’hexforecolor,hexbackcolor’ (colors separated by a comma).

Example

1
var text = "Test of <b>bold</b> <i>italic</i> <u>underline</u><br>larger <font size='20'>font</font>||<font color='00c600'>Forecolor</font> <font bgcolor='00c600'> Background </font>||<font colors='cb3d00,004500'> Both combined </font>||regular";

FormatTextBlock

Formats a TextBlock using HTML-like formatting codes.

1
RichTextFormatterHelper.FormatTextBlock(text, textBlock);

FormatRichTextBlock

Formats a RichTextBlock using HTML-like formatting codes.

1
RichTextFormatterHelper.FormatRichTextBlock(text, richTextBlock);

DevWinUI

Demo

you can run demo and see this feature.

0%