silverlight 退出当前页面、跳转到主页面

1.退出当前页面

1  private void imgExit_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
2         {
3             if (MessageBox.Show("确定要退出当前页面?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
4             {
5                 //Silverlight调用JS
6                 ScriptObject Show = HtmlPage.Window.GetProperty("closeWin") as ScriptObject;
7                 Show.InvokeSelf();
8             }
9         }

2.跳转到主页面

1 private void imgExit_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
2         {
3             if (MessageBox.Show("确定要退出当前页面?", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
4             {
5                 HtmlWindow window = HtmlPage.Window;
6                 window.Navigate(new Uri("Default.aspx", UriKind.Relative));
7 
8             }
9         }

 

posted @ 2014-12-26 14:09  银河系上的地球  阅读(396)  评论(0编辑  收藏  举报