private IAsyncOperation<ContentDialogResult> _Task = null;
private ContentDialog _message = null;
_message = new ContentDialog()
{
Content = "Hello",
PrimaryButtonText = "EXIT",
IsPrimaryButtonEnabled = true,
};
_message.PrimaryButtonClick += message_PrimaryButtonClick;
_Task = _message.ShowAsync();
在这里,我为内容对话框创建了一个任务,以便我可以从代码中显式关闭 ContenDialog。
How can I prevent dialog from closing when Home key is pressed and relaunched