private void OnAdd() { var win = new ManualAddWindow(); win.ShowDialog(); Manuals = _mSrv.GetManuals(); if (Manuals.Count != 0) { SelManual = Manuals.First(); } }
public ManualViewModel(IMapper mapper, Fanuc fanuc, ManualService mSrv) { this._fanuc = fanuc; this._mapper = mapper; this._mSrv = mSrv; _AddCmd = new RelayCommand(OnAdd); _DeleteCmd = new RelayCommand(OnDelete); _OpenCmd = new RelayCommand(OnOpen); Manuals = _mSrv.GetManuals(); if (Manuals.Count != 0) { SelManual = Manuals.First(); } }
private void OnDelete() { if (SelManual == null) { Messenger.Default.Send <string>("请选择说明书", "OperateNotice"); return; } try { _mSrv.Delete(SelManual); } catch (Exception ex) { Messenger.Default.Send <string>("删除说明书失败", "OperateNotice"); } Manuals = _mSrv.GetManuals(); if (Manuals.Count != 0) { SelManual = Manuals.First(); } }