private async void Logout_OnClick(object sender, RoutedEventArgs e) { MessageDialogResult result = await this.ShowMessageAsync("Exit Application", "Do You really want to Exit?", MessageDialogStyle.AffirmativeAndNegative); if (result == MessageDialogResult.Negative) { return; } else { CurrentUserLoggedInData.ClearUserData(); new MainWindow().Show(); Hide(); // Application.Current.Shutdown(); } }
private async void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; MessageDialogResult result = await this.ShowMessageAsync("Exit Application", "Do You really want to Exit?", MessageDialogStyle.AffirmativeAndNegative); if (result == MessageDialogResult.Negative) { e.Cancel = false; } else { CurrentUserLoggedInData.ClearUserData(); new MainWindow().Show(); Hide(); // Application.Current.Shutdown(); } }