AnsweredAssumed Answered

CommitAsync() is not called

Question asked by deleted-user-WOOhbEScR4vX on Nov 8, 2018
Latest reply on Nov 9, 2018 by cmacleod-esristaff

Hello,

 

if I override the functions "CommitAsync()" and "CancelAsync()" from the class "ArcGIS.Desktop.Framework.Contracts.Page" the functions are not called when I press OK or Cancel in the GUI. Can anybody confirm this bug or am I doing something wrong? 

 

public class ProApplicationSettingsViewModel : Page
     {

          /// <summary>
          /// Invoked when the OK or apply button on the property sheet has been clicked.
          /// </summary>
          /// <returns>A task that represents the work queued to execute in the ThreadPool.</returns>
          /// <remarks>This function is only called if the page has set its IsModified flag to true.</remarks>
          protected override Task CommitAsync()
          {
               MessageBox.Show("OK clicked.");
               return Task.FromResult(0);
          }

          protected override Task ResetAsync()
          {
               return Task.FromResult(true);
          }

          protected override Task CancelAsync()
          {
               return Task.FromResult(true);
          }

          /// <summary>
          /// Called when the page loads because to has become visible.
          /// </summary>
          /// <returns>A task that represents the work queued to execute in the ThreadPool.</returns>
          protected override Task InitializeAsync()
          {
               return Task.FromResult(true);
          }

          /// <summary>
          /// Called when the page is destroyed.
          /// </summary>
          protected override void Uninitialize()
          {
          }
     }

 

InitializeAsync() and Uninitialize() are working fine.

 

Thank you for your help.

 

Best regards.

Outcomes