/// <summary> 命令通用方法 </summary> protected override async void RelayMethod(object obj) { string command = obj?.ToString(); // Do:登录 if (command == "Button.Click.Login") { if (this.PassWord == "111111") { _domain.GoToLinkAction("Loyout", "Home"); return; } MessageService.ShowSnackMessageWithNotice("身份证号正确,请输入111111"); } // Do:设置 else if (command == "Button.Click.Setting") { this.Stop(); _domain.GoToLinkAction("Setting", "Setting"); AdminLoginControl adminLogin = new AdminLoginControl(); var result = await MessageService.ShowCustomDialog <bool>(adminLogin); if (result) { return; } _domain.GoToLinkAction("Login", "Login"); } /// <summary> 退出 </summary> else if (command == "Button.Click.ShutDown") { this.Stop(); (System.Windows.Application.Current.MainWindow as WindowBase)?.Close(); } /// <summary> 超时屏保 </summary> else if (command == "Button.Click.Awaitting") { this.Stop(); this.ShowWaitting(); } }
/// <summary> 命令通用方法 </summary> protected override async void RelayMethod(object obj) { string command = obj?.ToString(); // Do:对话消息 if (command == "Button.Click.Sumit") { this.Stop(); // Do :输入身份证号 var result = await System.Windows.Application.Current.Dispatcher.Invoke(async() => { CardIDControl card = new CardIDControl(); return(await MessageService.ShowCustomDialog <bool>(card)); }); _domain.GoToLinkAction("Report", "Report", new object[] { this.LinkActions, true }); } // Do:等待消息 else if (command == "Button.Click.Next") { GoNext(); } // Do:等待消息 else if (command == "Button.Click.ReMeasure") { this.Stop(); this.SelectLink.Clear(); await CheckAndRunMeasure(this.SelectLink); } //if (obj is SelectionChangedEventArgs args) //{ // if (this.SelectLink == null) return; // if (args.RemovedItems.Count > 0 && args.RemovedItems[0] is LinkActionEntity old) // { // old.Stop(); // } // //await CheckAndRunMeasure(this.SelectLink); //} }
/// <summary> 命令通用方法 </summary> protected override async void RelayMethod(object obj) { string command = obj?.ToString(); // Do:对话消息 if (command == "Button.Click.Save") { _domain.GoToLinkAction("Login", "Login", new object[] { false }); } // Do:等待消息 else if (command == "Cancel") { } }