所以基本上..我在一个框架中添加了2个新页面,当我按下一个按钮时它会改变框架..
但如果我检查第一页上的复选框,我不会检查是否转到另一页然后返回第一页..
这是一个更直观的外观http://recordit.co/Py3zptKLck
源代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace CheckboxesAndPages
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button_Click(object sender, RoutedEventArgs e)
{
main.Content = new SecondPage();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
main.Content = new thirdPage();
}
}
}
这2页没有源代码。
答案 0 :(得分:1)
你每次都给它一个新的第二页
SecondPage secondPage = new SecondPage();
private void button_Click(object sender, RoutedEventArgs e)
{
main.Content = secondPage;
}