private void BtnLogin_Click(object sender, RoutedEventArgs e) { if (_isProcessing) { return; } if (!ValidatePassword()) { return; } _isProcessing = true; ButtonHelper.SetIsPending(BtnLogin, true); FrmPassword.ValidateResult = ValidateResult.None; FrmPassword.Message = null; }
protected override void OnClosing(CancelEventArgs e) { //Press Continue Button if (DialogResult == true) { if (_isProcessing) { e.Cancel = true; return; } if (!ValidateForm()) { e.Cancel = true; return; } _isProcessing = true; var okButton = WindowXModalDialog.GetOKButton(this); ButtonHelper.SetIsPending(okButton, true); e.Cancel = true; } base.OnClosing(e); }