public MainWindowViewModel() { #region starting view content logHandler = LogHandler.Instance; logHandler.MainWindowViewModel = this; ContentHandler.StartContent(); Refresh(); #endregion #region Commands AddUserCommand = new AddUserCommand(this); ViewProfilInfoCommand = new ViewProfilInfoCommand(this); AddTelephoneCommand = new AddTelephoneCommand(this); AddShopCommand = new AddShopCommand(this); ChangeTelephoneCommand = new ChangeTelephoneInfoCommand(this); DeleteTelephoneCommand = new DeleteTelephoneCommand(this); DuplicateTelephoneCommand = new DuplicateTelephoneCommand(this); ChangeShopCommand = new ChangeShopInfoCommand(this); DeleteShopCommand = new DeleteShopCommand(this); LogOutCommand = new LogOutCommand(this); BuyTelephoneCommand = new BuyTelephoneCommand(this); ClearCommand = new ClearCommand(this); UndoCommand = new UndoCommand(this); RedoCommand = new RedoCommand(this); FilterCommand = new FilterCommand(this); RefreshCommand = new RefreshCommand(this); #endregion }
public async Task <CoreResult> Delete(long Id) { CoreResult result = new CoreResult(); DeleteShopCommand command = new DeleteShopCommand(Id); var res = await _bus.SendCommandAsync(command); if (res) { result.Success("删除成功"); } else { result.Failed("删除成功"); } return(result); }