silverlight中页面的跳转有点麻烦,需要修改app.xaml中的方法。 第一步:添加全局变量:Grid rootgrid=new Grid(); 第二步:修改Application_Startup方法改为 this.rootVisual=rootgrid; rootgird.Children.add(new MainPage()); 第三步:写一个方法如下 public void RedirectTo(UserControl usercontrol) 第四步:建立两个页面page1.xaml和page2.xaml在page1.xaml上加一个button 双击后写方法: App app = (App)Application.Current; 如果链接default.aspx页面则需要使用 HtmlWindow html = HtmlPage.Window; |