private void Cancel(object parameter) { try { if (!Chapter.ChaptersAreIdentical(Chapter, Chapter.FindChapter(Chapter.ID))) { MessageBoxResult result = MessageBox.Show("Отменить изменения?", "Подтвердите действие", MessageBoxButton.YesNo); if (result != MessageBoxResult.Yes) { return; } } Navigation.NavigateToPage(Navigation.Pages.Chapters_View); } catch (Exception ex) { MessageBox.Show($"Не удалось отменить изменения: {ex.Message}"); } }