private void Login_button_OnClick(object sender, RoutedEventArgs e) { // Get data from Window var password = password_passwordBox.Password; var login = login_textBox.Text; // Check parameters if (!CheckLoginParameters()) { return; } // Let service validate user var proxy = new Proxy.Proxy(); var message = proxy.ValidateUser(login, password); if (message.IsError) { // Show service mesasge ClientUtils.ShowMessage(message); password_passwordBox.Password = ""; return; } // If everythings fine send data to MainWindow, show the window ... DialogFinished?.Invoke(this, new LoginWindowEventArgs(message.MessageText)); _mainWindow.Show(); // ... and close LoginWindow Close(); }
protected virtual void OnDialogFinished(IDialog dialog) { dialog.OnFinish(); DialogFinished?.Invoke(this, EventArgs.Empty); }
public void OnFinish() { DialogFinished?.Invoke(this, EventArgs.Empty); }