Skip to content

Instantly share code, notes, and snippets.

@lambda125
Created September 2, 2012 09:43
Show Gist options
  • Save lambda125/3596276 to your computer and use it in GitHub Desktop.
Save lambda125/3596276 to your computer and use it in GitHub Desktop.
Using the webview wrapper control to display content from a URL with fallback local content
<Page
x:Class="Metro.Controls.Demo.Samples.WebViewHostSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:MetroControls="using:MetroControls"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<MetroControls:WebViewHostControl HeaderText="Help content that should work"
Uri="http://www.bing.com"
LocalFallbackUri="/Assets/LocalHelp.html" />
<MetroControls:WebViewHostControl Grid.Row="1"
HeaderText="Help content with fallback for failed navigation"
Uri="http://somethinginvalidhere.fail"
LocalFallbackUri="/Assets/LocalHelp.html" />
</Grid>
</Page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment