我创建了一个带有UserControl
的WPF WebBrowser
。它在运行后加载页面但不显示加载的页面。
<UserControl x:Class="PsyboInventory.Tiles.About.AboutTile"
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"
d:DesignHeight="500" d:DesignWidth="800">
<Grid>
<WebBrowser x:Name="browser" Height="253" Margin="300,96,36,0" VerticalAlignment="Top"/>
</Grid>
</UserControl>
关于cs代码
public AboutTile()
{
InitializeComponent();
try
{
browser.Loaded += delegate
{
browser.Navigate("http://www.google.fi/");
};
}
catch { }
}