SilverLight xaml页面跳转方法

1. App.xaml.cs页中定义全局的Grid对象

例如:Grid rootGrid = new Grid();

2. 将对象rootGrid添加到App.xaml.cs文件中的 Application_Startup 方法中

如:  private void Application_Startup(object sender, StartupEventArgs e)
        {
            this.RootVisual = rootGrid;
            this.rootGrid.Children.Add(new Page());
        }

3.在App.xaml.cs中添加一个新方法

如:public staitc void Redirect(UserControl userControl)

  {

    App app=(App)Application.Current;

    app.rootGrid.Children.Clear();

    app.rootGrid.Children.Add(userControl);

  }

4.在方法中调用写好的方法

    private void Button_Click(object sender, RoutedEventArgs e)
    {
          App.Redirect(new SilverlightControl1());
    }

关于页面之间如何传递参数及跳转请参考:http://blog.csdn.net/luminji/archive/2010/03/01/5335844.aspx

原文地址:https://www.cnblogs.com/michaelShao/p/1763748.html