public Task<bool> DiscardEditsAsync()
Public Function DiscardEditsAsync() As Task(Of Boolean)
Return Value
true if discarding edits is successful
public Task<bool> DiscardEditsAsync()
Public Function DiscardEditsAsync() As Task(Of Boolean)
// if editing if (Project.Current.IsEditingEnabled) { var res = MessageBox.Show("Do you want to disable editing? Editing tools will be disabled", "Disable Editing?", System.Windows.MessageBoxButton.YesNoCancel); if (res == System.Windows.MessageBoxResult.No || res == System.Windows.MessageBoxResult.Cancel) { return; } //we must check for edits if (Project.Current.HasEdits) { res = MessageBox.Show("Save edits?", "Save Edits?", System.Windows.MessageBoxButton.YesNoCancel); if (res == System.Windows.MessageBoxResult.Cancel) return; else if (res == System.Windows.MessageBoxResult.No) Project.Current.DiscardEditsAsync(); else { Project.Current.SaveEditsAsync(); } } Project.Current.SetIsEditingEnabledAsync(false); }
Target Platforms: Windows 11, Windows 10, Windows 8.1