复合命令
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; } }