1、界面布局,文本框和按钮

2、声明并定义命令private RoutedCommand sayCmd = new RoutedCommand("Say", typeof(MainWindow));

8、命令可执行逻辑e.CanExecute = myText.Text.ToString() == "" ? false : true;

10、执行效果如下

时间:2024-11-03 09:37:42
1、界面布局,文本框和按钮

2、声明并定义命令private RoutedCommand sayCmd = new RoutedCommand("Say", typeof(MainWindow));

8、命令可执行逻辑e.CanExecute = myText.Text.ToString() == "" ? false : true;

10、执行效果如下
