//构造函数
public MainWindowViewModel()
{
EditCommand = new DelegateCommand(_editCommand);
}
//命令声明一
public DelegateCommand EditCommand { get; set; }
//构造函数中实例化委托
void _editCommand() {
MessageBox.Show("EditCommand ");
}
//命令生命方式二
private DelegateCommand _testCmd;
public DelegateCommand TestCmd =>
_testCmd ?? (_testCmd = new DelegateCommand(ExecuteTestCmd));
void ExecuteTestCmd()
{
MessageBox.Show("ExecuteTestCmd");
}
标签:DelegateCommand,自定义,prism,EditCommand,ExecuteTestCmd,testCmd,public,构造函数
From: https://www.cnblogs.com/douyuanjun/p/17797589.html