public class ViewAViewModel : BindableBase { private string _message; public string Message { get { return _message; } set { SetProperty(ref _message, value); } } public ViewAViewModel() { Message = "View A from your Prism Module"; Command1 = new DelegateCommand(() => { Message = "CMD1 "; }); Command2 = new DelegateCommand(() => { Message += "CMD2 "; }); OpenAll = new CompositeCommand(); OpenAll.RegisterCommand(Command1); OpenAll.RegisterCommand(Command2); } public DelegateCommand Command1 { get; private set; } public DelegateCommand Command2 { get; private set; } public CompositeCommand OpenAll { get; private set; } }
标签:set,get,复合,private,命令,DelegateCommand,OpenAll,public From: https://www.cnblogs.com/chixiner/p/17233836.html