In my WPF project, I need to display HTML-based content where the content is stored in the resource assembly referenced by my WPF project.
I looked at the WPF Frame and WebBrowser controls. Unfortunately, they both reveal only navigation events (Navigation, Navigation), but not any events that would allow me, based on the requested URL, to return the HTML content received from the resource assembly.
I can intercept navigation requests and serve HTML content using the navigation event and the NavigateToString () method. But this does not work to intercept calls to download images, CSS files, etc.
In addition, I know that HTML is in the application example FlowDocument SDK , which may be useful, but I will probably have to significantly expand the selection for image processing and style sheets.
For what it's worth, we also create HTML content that needs to be rendered (via Wiki pages), so the original HTML is somewhat predictable (for example, there can be no JavaScript) in terms of image link locations and CSS styles used. We want to display random HTML content from the Internet.
Update: There is also the possibility of creating an MHT file for each HTML page, which would "embed" all images in the form of MIME types and reduce the need for finer callbacks.
html mhtml controls wpf
Philip schmid
source share