我有一个 WebBrowser 控件,我想在这个控件上显示一些 url。在浏览器加载页面之前,我需要显示一些进度条或动画。
请帮助我,这就是我所拥有的:
XAML:
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<ProgressBar x:Name="progressbar" IsIndeterminate="True"/>
<phone:WebBrowser x:Name="webbrw" IsScriptEnabled="True"/>
</Grid>
强文本
public MainPage()
{
InitializeComponent();
// Sample code to localize the ApplicationBar
//BuildLocalizedApplicationBar();
Loaded += MainPage_Loaded;
}
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
webbrw.LoadCompleted += webbrw_LoadCompleted;
webbrw.Source = new Uri("http://www.youtube.com/user/tseries");
}
void webbrw_LoadCompleted(object sender, NavigationEventArgs e)
{
progressbar.IsIndeterminate = false;
}