private void Save_Executed(object sender, ExecutedRoutedEventArgs e) { if (ApplicationView.Status != StatusKind.Ready) { ApplicationView.SignalOperationInProgress(); return; } var control = (EditableAvalonEditor)sender; var searchResult = control.DataContext as SearchResultViewModel; if (searchResult == null) { return; } try { control.PreviewEditor.Save(searchResult.GetFilePath()); ApplicationView.SignalPreviewSaved(); } catch { ApplicationView.SignalOperationCancelled(); } }