private void RegistrationWindow_Closed(object sender, EventArgs e) { if (_dialogResult != 1) { _authenticationWindow.ShowDialog(); } }
public MainWindow() { AuthenticationWindow aw = new AuthenticationWindow(hb); if (aw.ShowDialog() != true) { Close(); return; } user = aw.User; InitializeComponent(); Title = "Домашня бугалтерія - " + user.Name; curUserControl = ouc = new OrdersUserControl(hb); GridMain.Children.Add(ouc); GridFilters.Children.Add(ouc.FilterUserControl); buc = new BalanceUserControl(hb); GridMain.Children.Add(buc); erfpuc = new ExpensesRevenuesForPeriodUserControl(hb); GridMain.Children.Add(erfpuc); buc.Visibility = erfpuc.Visibility = Visibility.Collapsed; curButton = ButtonOrders; FieldChange("ButtonOrders"); UpdateAll(); }
private bool Authenticate(Window window) { window.Hide(); AuthenticationWindow authentication = new AuthenticationWindow(); if (authentication.ShowDialog() == true) { window.Show(); return(true); } return(false); }
public static string AuthenticateTwitch(string username, bool isBot) { var authwindow = new AuthenticationWindow(username, isBot); if (authwindow.ShowDialog() == true) { return(authwindow.Oauth); } else { return(null); } }
public static string AuthenticateTwitch(string username, bool isBot) { var authwindow = new AuthenticationWindow(username, isBot); if (authwindow.ShowDialog() == true) { //System.Console.WriteLine("My Oauth: " + authwindow.Oauth); return(authwindow.Oauth); } else { return(null); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); AuthenticationWindow authWindow = new AuthenticationWindow(); AuthenticationViewModel authWindowViewModel = new AuthenticationViewModel(); authWindow.DataContext = authWindowViewModel; authWindowViewModel.LoginCompleted += (sender, args) => { MainWindow = new MainWindow(); MainWindow.Show(); authWindow.Close(); }; authWindow.ShowDialog(); }
public MainWindowViewModel(MainWindow window) { AddNewEntityCommand = new DelegateCommand <object>(AddNewEntity, CanAddNewEntity); ShowAllInfoAboutSelectedAuthorCommand = new DelegateCommand <object>(ShowAllInfoAboutSelectedAuthor, CanShowAllInfoAboutSelectedAuthor); ShowAllInfoAboutSelectedPublisherCommand = new DelegateCommand <object>(ShowAllInfoAboutSelectedPublisher, CanShowAllInfoAboutSelectedPublisher); _mainWindow = window; var authenticationViewModel = new AuthenticationViewModel(); authenticationViewModel.SignInConfirmed += AuthenticationViewModel_SignInConfirmed; authenticationViewModel.SignInSkipped += AuthenticationViewModel_SignInSkipped; authenticationViewModel.SignUpConfirmed += AuthenticationViewModel_SignUpConfirmed; _authenticationWindow = new AuthenticationWindow(authenticationViewModel); _mainWindow.SourceInitialized += delegate { _mainWindow.ShowActivated = false; _mainWindow.Hide(); _authenticationWindow.Closed += AuthenticationWindow_Closed; _authenticationWindow.ShowDialog(); }; }
public static void Authenticate() { while (true) { AuthenticationWindow authenticationWindow = new AuthenticationWindow(); authenticationWindow.ShowDialog(); if (authenticationWindow.Tag == null) { AsynchronousClientSocket.Shutdown(); Process.GetCurrentProcess().CloseMainWindow(); } else if ((AuthenticationDialogResult)authenticationWindow.Tag == AuthenticationDialogResult.Authenticated) { break; } else if ((AuthenticationDialogResult)authenticationWindow.Tag == AuthenticationDialogResult.ShowRegWin) { RegistrationWindow registrationWindow = new RegistrationWindow(); registrationWindow.ShowDialog(); if (registrationWindow.Tag == null) { AsynchronousClientSocket.Shutdown(); Process.GetCurrentProcess().CloseMainWindow(); } } } }