Tiles, Toasts, and Notifications in Windows Store Apps
Showing Progress, Changing State

Using the Windows Store App WebView Control with CSS

With Windows 8.1 a major update of the WebView control is available. The updates make the control usable with many different scenarios.

In one project I'm using the WebView control to dynamically get HTML content via a string from a Web service, and make use of a CSS style sheet file that is stored with the Windows Store app.

Loading HTML content from a string can now be done by calling the method NavigateToString:

string htmlContent = service.GetHtml();

Referencing the style sheet that is stored with the Windows Store app is done via the ms-appx-web prefix with the link to the style sheet. The WebView control doesn't support ms-appx, but ms-appx-web is possible:

<link href="ms-appx-web:///css/Styles.css" rel="stylesheet" />




Feed You can follow this conversation by subscribing to the comment feed for this post.

The comments to this entry are closed.