I have a user control in my wpf application. and inside this user control i have web browser control.
when I navigate to some web page, it is not showing up anything. I can see that http call is happening and navigated event of web browser control is firing. but nothing is showing up.
Any help would be appreciated.
XAML looks like this
<UserControl
x:Class="Client.Module.LmpView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
DataContextChanged="UserControl_DataContextChanged"
xmlns:module="clr-namespace:Client.Module"
xmlns:WinForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms">
<!--
<StackPanel>
<WindowsFormsHost x:Name="wfh" Width="400" Height="400"/>
</StackPanel>
-->
<TextBlock>
<WebBrowser Width="400" Height="400" Navigated="LinkedInProfileDisplayControl_Navigated" x:Name="LinkedInProfileDisplayControl" AllowDrop="True" />
</TextBlock>
</UserControl>
Code behind file
private void UserControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (this.DataContext != null)
{
LinkedInProfileDisplayControl.Navigate((this.DataContext as LinkedInMemberProfileViewModel).LinkedInMemberProfileUrl);
}
}
WebBrowser
is part ofTextBlock
? Did you try removingTextBlock
and leaving justWebBrowser
? – dkozl