private void WebView_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
// Once the browser is initialised, load the HTML for the tab.
if (!this.webViewIsReady)
{
if (e.PropertyName.Equals("IsBrowserInitialized", StringComparison.OrdinalIgnoreCase))
{
this.webViewIsReady = this.WebView.IsBrowserInitialized;
if (this.webViewIsReady)
{
string resourceName = "Yaircc.UI.ThemeSample.htm";
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
{
using (StreamReader reader = new StreamReader(stream))
{
this.WebView.LoadHtml(reader.ReadToEnd());
}
}
}
}
}
// Once the HTML has finished loading, begin loading the initial content.
if (e.PropertyName.Equals("IsLoading", StringComparison.OrdinalIgnoreCase))
{
if (!this.WebView.IsLoading && this.pendingTheme != null)
{
this.LoadThemePreview(this.pendingTheme);
}
}
}