Table of Contents
WebView.Preload Method (Int32, Int32, String, WebViewCallback, Object)

Create a WebView and preload a Url.

Syntax
 public static PreloadTask Preload(
   int width,
   int height,
   string url,
   WebViewCallback doneCallback,
   object doneCallbackArgs
);

Parameters

width
The width of the WebView.
height
The height of the WebView.
url
The url to be loaded.
doneCallback
The delegate to be called when the url has finished loading.
doneCallbackArgs
Optional argument to be passed to the callback.

Return Value

Returns a PreloadTask that you can use to wait for the preload to complete.

Remarks

The following code demonstrates how to preload a Url.

//The preloaded webView
private WebView m_WebView;

//To preload a Url and store the result when done
PreloadTask task = WebView.Preload(
    300, 400, "http://www.google.com",
    (newWebView, arg) =>
    {
        m_WebView = newWebView;
        return null;
    }, null);
    
//To wait for the preload to complete
task.WaitOne();
    
//Use preloaded WebView
webControl1.WebView = m_WebView;

See Also