UWP: Better use XAML's RichTextBlock than a TextBox for neat rendering of text?
I wanted to disaply in my app a somewhat large amount of text contained in three paragaphs. Using a textbox with wrapping and scrolling did show all the text. However, as displayed text it was not satisfactory. Using 'paragraphs' inside 'RichTextBlock' provided the best option.
The XAML code shows a TextBox and a RichTextBlock with three 'Paragraph' controls. Both of them inside a 'ScrollViewer' which makes it easy to scroll the text as shown.
Here is the code for the MainPage.XAML
This is the result rendered in the Local Machine.
The XAML code shows a TextBox and a RichTextBlock with three 'Paragraph' controls. Both of them inside a 'ScrollViewer' which makes it easy to scroll the text as shown.
Here is the code for the MainPage.XAML
This is the result rendered in the Local Machine.
This one rendered to an emulator (4")
Comments