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.
Solved! Go to Solution.
Flag your page as "dirty" - this.IsModified = true - this tells the property sheet that you have changes to commit. This guide might help - it does a step-by-step implementation: https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Custom-settings
Flag your page as "dirty" - this.IsModified = true - this tells the property sheet that you have changes to commit. This guide might help - it does a step-by-step implementation: https://github.com/esri/arcgis-pro-sdk/wiki/ProGuide-Custom-settings