Okay I found a quick solution,
define a IAsyncOperation class varialble
IAsyncOperation<IUICommand> asyncCommand = null;
and set it to the ShowAsync method of MessageDialog
asyncCommand = msg.ShowAsync();
In the command handler for retry/try again
check if asyncCommand is not null and cancel the last operation if necessary
if(asyncCommand != null)
{
asyncCommand.Cancel();
}
Please let me if there is a better approach to this.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…