IsEditingEnabled Property
Gets a value that indicates if editing is enabled.
public bool IsEditingEnabled {get;}
Public ReadOnly Property IsEditingEnabled As Boolean
Property Value
True if editing is enabled; otherwise, false.
Enable Editing
// if not editing
if (!Project.Current.IsEditingEnabled)
{
var res = MessageBox.Show("You must enable editing to use editing tools. Would you like to enable editing?",
"Enable Editing?", System.Windows.MessageBoxButton.YesNoCancel);
if (res == System.Windows.MessageBoxResult.No ||
res == System.Windows.MessageBoxResult.Cancel)
{
return;
}
Project.Current.SetIsEditingEnabledAsync(true);
}
Disable Editing
// 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
ArcGIS Pro version: 3 or higher.