How to prevent the ContentDialog from closing when home key is pressed in Windows phone 8.1..?

前端 未结 1 1231
时光说笑
时光说笑 2021-01-12 15:21
private IAsyncOperation _Task = null;
private ContentDialog _message = null;            


        _message = new ContentDialog()
                 


        
1条回答
  •  被撕碎了的回忆
    2021-01-12 16:22

    To prevent the dialog from closing handle its Closing event and set Cancel to true in its ContentDialogClosingEventArgs argument.

    When initializing the dialog:

    myContentDialog.Closing += ContentDialog_Closing; 
    

    Event handler:

    void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
    {
        if (doNotClose)
        {
            args.Cancel = true;
        }
    }
    

    0 讨论(0)
提交回复
热议问题