<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Not able to undo after EditOperation.Execute() in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/not-able-to-undo-after-editoperation-execute/m-p/1292542#M9846</link>
    <description>&lt;P&gt;In order to use Undo/Redo you have to 'save' your edits first.&amp;nbsp; More details are here:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#edit-sessions" target="_blank" rel="noopener"&gt;ProConcepts Editing · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In short these are the relevant methods:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Save edits:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;await Project.Current.SaveEditsAsync();&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9204.html" target="_blank" rel="nofollow noopener"&gt;SaveEditsAsync&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Discard Edits:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;await Project.Current.DiscardEditsAsync();&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9197.html" target="_blank" rel="nofollow noopener"&gt;DiscardEditsAsync&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Has Edits:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Project.Current.HasEdits&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9218.html" target="_blank" rel="nofollow noopener"&gt;HasEdits&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Wed, 24 May 2023 14:21:53 GMT</pubDate>
    <dc:creator>Wolf</dc:creator>
    <dc:date>2023-05-24T14:21:53Z</dc:date>
    <item>
      <title>Not able to undo after EditOperation.Execute()</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/not-able-to-undo-after-editoperation-execute/m-p/1289983#M9827</link>
      <description>&lt;P&gt;I created a custom function to update a feature attribute.&lt;/P&gt;&lt;P&gt;I started by adding a dock pane and binding an update action to a button.&lt;/P&gt;&lt;P&gt;The update was a success, but I cannot undo it with the built-in undo button of ArcGIS Pro, which is dimmed. I can only discard the edit by using the discard button. I am wondering what's wrong. I would be grateful if anyone could point me in a direction.&lt;/P&gt;&lt;P&gt;part of the dock pane xaml&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;Button Content="Update"
Command="{Binding Update}"/&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;part of the C# of the ViewModel&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;private ICommand update;
public ICommand Update
{
	get
	{
		if (update == null)
		{
			update = new RelayCommand(() =&amp;gt; UpdateFeatureNumber());
		}
		return update;
	}
}

private void UpdateFeatureNumber()
{
	QueuedTask.Run(() =&amp;gt;
	{
		EditOperation editOperation = new EditOperation
		{
			Name = "Update Attribute"
		};
		editOperation.Modify(currentRow, "Field", value);
		if (editOperation.Execute())
		{
			ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("Updated.", "Update Attribute", MessageBoxButton.OK, MessageBoxImage.Information);
			return;
		}
	});
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 07:22:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/not-able-to-undo-after-editoperation-execute/m-p/1289983#M9827</guid>
      <dc:creator>OscarYam</dc:creator>
      <dc:date>2023-05-17T07:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to undo after EditOperation.Execute()</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/not-able-to-undo-after-editoperation-execute/m-p/1290064#M9828</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to override&amp;nbsp;OperationManager method of your dockpane:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        public override OperationManager OperationManager
        {
            get
            {
                return MapView.Active?.Map.OperationManager;
            }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More info you can find here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic10432.html" target="_self"&gt;https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic10432.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Dockpanes" target="_self"&gt;https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Dockpanes&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2023 13:17:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/not-able-to-undo-after-editoperation-execute/m-p/1290064#M9828</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-05-17T13:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to undo after EditOperation.Execute()</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/not-able-to-undo-after-editoperation-execute/m-p/1292542#M9846</link>
      <description>&lt;P&gt;In order to use Undo/Redo you have to 'save' your edits first.&amp;nbsp; More details are here:&amp;nbsp;&amp;nbsp;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#edit-sessions" target="_blank" rel="noopener"&gt;ProConcepts Editing · Esri/arcgis-pro-sdk Wiki (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In short these are the relevant methods:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Save edits:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;await Project.Current.SaveEditsAsync();&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9204.html" target="_blank" rel="nofollow noopener"&gt;SaveEditsAsync&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Discard Edits:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;await Project.Current.DiscardEditsAsync();&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9197.html" target="_blank" rel="nofollow noopener"&gt;DiscardEditsAsync&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Has Edits:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Project.Current.HasEdits&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9218.html" target="_blank" rel="nofollow noopener"&gt;HasEdits&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 24 May 2023 14:21:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/not-able-to-undo-after-editoperation-execute/m-p/1292542#M9846</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-05-24T14:21:53Z</dc:date>
    </item>
  </channel>
</rss>

