public MinerGroupViewModel(Guid id) { _id = id; this.Save = new DelegateCommand(() => { if (NTMinerRoot.Current.MinerGroupSet.Contains(this.Id)) { Global.Execute(new UpdateMinerGroupCommand(this)); } else { Global.Execute(new AddMinerGroupCommand(this)); } CloseWindow?.Invoke(); }); this.Edit = new DelegateCommand(() => { MinerGroupEdit.ShowEditWindow(this); }); this.Remove = new DelegateCommand(() => { if (this.Id == Guid.Empty) { return; } DialogWindow.ShowDialog(message: $"您确定删除{this.Name}吗?", title: "确认", onYes: () => { Global.Execute(new RemoveMinerGroupCommand(this.Id)); }, icon: "Icon_Confirm"); }); }
public MinerGroupViewModel(Guid id) { _id = id; this.Edit = new DelegateCommand(() => { MinerGroupEdit.ShowEditWindow(this); }); this.Remove = new DelegateCommand(() => { if (this.Id == Guid.Empty) { return; } DialogWindow.ShowDialog(message: $"您确定删除{this.Name}吗?", title: "确认", onYes: () => { Global.Execute(new RemoveMinerGroupCommand(this.Id)); }, icon: "Icon_Confirm"); }); }