public SignInWindow() { InitializeComponent(); App app = ((App)Application.Current); if (app.CurrentUser != null) { // Already signed in var chatListWindow = new ChatListWindow(); chatListWindow.Show(); Close(); return; } var signInViewModel = new SignInViewModel(); signInViewModel.RequestClose += CloseOrListChatsIfSignedIn; signInViewModel.RequestLoader += OnRequestLoader; signInViewModel.RequestVisibilityChange += (x) => Visibility = x; DataContext = signInViewModel; }
private void CloseOrListChatsIfSignedIn(bool isQuitApp) { App app = ((App)Application.Current); if (!isQuitApp) { if (app.CurrentUser != null) { var chatListWindow = new ChatListWindow(); chatListWindow.Show(); Close(); return; } } if (!isQuitApp) { Close(); } else { app.ShutDown(0); } }