I'm trying to implement a User Control which hosts a WebViewer (the User Control is a child of a PopUp) to no avail!
The User Control XAML is
<Grid Background="LightGray">
<StackPanel>
<Button Click="Button_Click">Go to microsoft.com</Button>
<WebView x:Name="webView"></WebView>
</StackPanel>
</Grid>
The C# code behind is:
public sealed partial class Help : UserControl
{
public Help()
{
this.InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
webView.Navigate(new Uri(@"http://microsoft.com"));
}
}
Clicking the button does not display the web page. This works if WebView is in a page.
Is there a problem with WebView in a User Control or is it because the User Control's parent is PopUp? Or am I going crazy?
As always any help will be gratefully received.