コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
 private void SaveMenuItem_Click(object sender, RoutedEventArgs e)
 {
     ApplicationFacade.Save();
 }