WPF **的分部声明一定不能指定不同的基类和Window与Page的界面跳转

1…的分部声明一定不能指定不同的基类
遇到这个问题,有可能是xaml和cs里面的类型不一致。
注意两边保持一致。
页(page),用户控件(userControl),窗口(window)
在这里插入图片描述
在这里插入图片描述
2.界面跳转
Page跳转到Window

private void Quit_Click(object sender, RoutedEventArgs e)
        {
            MainWindow main = new MainWindow();
            main.Show();
        }

Window跳转到Page

private void Print_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.Content = new Warehouse();
        }