question

SudhaSub avatar image
0 Votes"
SudhaSub asked AryaDing-MSFT commented

[UWP] Display Html data

Hi,

I need to implement screen which has 500-1000 items, here we called as steps with html data. Also each step has other button controls to perform some actions on each step. One step displays html content including multi-level bullet/numbering lists, colors etc.

I tried with RichTextBlock by processing html content to displayable format. But I found that it is hard to show multi-level bullets and numbered lists in RichTextBlock. I didn't found a better way to process them and as in https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.documents?view=winrt-19041, it does not support bullets etc.

I am going to try with web view, but it says having large nu of web views (500 -1000) will be subjected to memory leak issues. So can you please give your ideas on resolving those issues in a better way?

Thanks

windows-uwp
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SudhaSub I suggest you could use Paragraph class to achieve a similar numbering lists effect. When you recognize some HTML <li> tags, you can add special symbols before the inner text, such as &#x22C5(Dot Operator). Besides, what is your expected behavior? Do you mean to create 500-1000 webview?

0 Votes 0 ·

@AryaDing-MSFT Yes, If we use web view to display each content there will be 500-100 web views. The content has lot of custom tags also. So processing each one by one will requires more work. If we use 500 -1000 web views and clear memory on web views when we navigating to other screens, will there be any issue?

0 Votes 0 ·

@SudhaSub This behavior is not feasible, you can’t create so many webviews, it will strongly affect rendering and memory usage. My suggestion is that you could create a webView and combine your html documents. There is an <iframe/> html element, which represents a nested browsing context and embeds another HTML page into the current page. Therefore, you could use it to embed other html content into the main-page, and then use webview to load the main-page.

0 Votes 0 ·

0 Answers