private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (ApplicationFacade.HasDataChanged()) { var messageBoxResult = MessageBox.Show("Do you want to save the changes?", "Meeting Center", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning); switch (messageBoxResult) { case MessageBoxResult.None: case MessageBoxResult.Cancel: e.Cancel = true; break; case MessageBoxResult.Yes: this.ExecuteSafe(() => { ApplicationFacade.Save(); }, errorAction: () => e.Cancel = true); break; case MessageBoxResult.No: break; } } }
private void SaveMenuItem_Click(object sender, RoutedEventArgs e) { ApplicationFacade.Save(); }