IWebViewControl.NavigateToLocalStreamUri(Uri, IUriToStreamResolver) Method

Definition

Loads local web content at the specified URI using an IUriToStreamResolver.

public:
 void NavigateToLocalStreamUri(Uri ^ source, IUriToStreamResolver ^ streamResolver);
void NavigateToLocalStreamUri(Uri const& source, IUriToStreamResolver const& streamResolver);
public void NavigateToLocalStreamUri(System.Uri source, IUriToStreamResolver streamResolver);
function navigateToLocalStreamUri(source, streamResolver)
Public Sub NavigateToLocalStreamUri (source As Uri, streamResolver As IUriToStreamResolver)

Parameters

source
Uri Uri

A URI identifying the local HTML content to load.

streamResolver
IUriToStreamResolver

A resolver that converts the URI into a stream to load.

Remarks

Use this method to load local content that the NavigateToString method won't handle. NavigateToString provides an easy way to navigate to static HTML content, including content with references to resources such as CSS, scripts, images, and fonts. However, NavigateToString does not provide a way to generate these resources programmatically.

To use the NavigateToLocalStreamUri method, you must pass in an IUriToStreamResolver implementation that translates a URI pattern into a content stream. You can do this to supply the content for all the resources used by a web page, or series of pages. For example, you can use this method to display content saved on the local file system as encrypted files or in cab packages. When the content is requested, you can use an IUriToStreamResolver implementation to decrypt it on the fly.

The IUriToStreamResolver interface has one method, UriToStreamAsync which takes the URI and returns the stream. The URI is in the form of “ms-local-stream://appname_KEY/folder/file” where KEY identifies the resolver. Use BuildLocalStreamUri to create a URI in the correct format that references the local content to load.

Note

Your IUriToStreamResolver implementation must be agile to prevent deadlock that can occur when the UI thread waits for the IUriToStreamResolver to finish its work before continuing. For more info, see Threading and Marshaling

Applies to