private void OnClosing(object sender, CancelEventArgs cancelEventArgs) { ApplicationClosingAggEvent e = new ApplicationClosingAggEvent(); _eventAggregator.PublishEvent <ApplicationClosingAggEvent>(e); cancelEventArgs.Cancel = e.IsCancel; }
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; } } }