public MainWindow(IManagerService managerService) { _managerService = managerService; InitializeComponent(); ModalDialog.SetParent(ModalDialogParent); MessageBoxDialog.SetParent(ModalDialogParent); ImportQuestionDialog.SetParent(ModalDialogParent); Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() => { while (_managerProfile == null && !_formClosing) { _managerProfile = ModalDialog.ShowHandlerDialog(_managerService); if (_managerProfile != null) //Hack: Javad Rasouli >> Uncomment This TxbUserFullName.Text = /*_managerProfile.FullNameWithSexTitle;*/ "جواد رسولی"; else if (!_formClosing) { MessageBoxDialog.ShowHandlerDialog(new MessageDialogBox { MessageHeader = "اعتبار سنجی ورود", MessageBody = "نام کاربری یا کلمه عبور اشتباه است", Buttons = new List<EMessageDialogButton> { EMessageDialogButton.Ok}, }); } } })); }
private void BtnLogin_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(TxtUserName.Text) || string.IsNullOrWhiteSpace(TxtPassword.Password)) return; //HACK : Javad Rasouli >> Uncomment //_result = _managerService.Login(TxtUserName.Text, TxtPassword.Password); _result = new ManagerProfile(); HideHandlerDialog(); }
private void BtnCancel_Click(object sender, RoutedEventArgs e) { _result = null; HideHandlerDialog(); }