예제 #1
0
        private void OnClosing(object sender, CancelEventArgs cancelEventArgs)
        {
            ApplicationClosingAggEvent e = new ApplicationClosingAggEvent();

            _eventAggregator.PublishEvent <ApplicationClosingAggEvent>(e);
            cancelEventArgs.Cancel = e.IsCancel;
        }
예제 #2
0
 public void OnEventHandler(ApplicationClosingAggEvent e)
 {
     if (_repository.Categories.IsChanged)
     {
         string msg   = $"Plik {_repository.Categories.Path} zmienił się, czy wyjść?";
         bool   isYes = _iOutput.FileDialog.ShowQuestionDialog(msg, "Pytanie");
         if (!isYes)
         {
             e.IsCancel = true;
         }
     }
 }