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();
webView1.NavigateToString(htmlContent);

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" />

Christian

http://www.cninnovation.com

Comments

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

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)