1
在Windows Phone 8(或8.1)中,是否有辦法阻止在特定條件下按下主按鈕時關閉ContentDialog?例如,假設你有一個布爾值。當他們點擊主鍵時,我只想讓ContentDialog關閉if(done == true)。這可能嗎?如何防止在WP8中按下按鈕時關閉ContentDialog
在Windows Phone 8(或8.1)中,是否有辦法阻止在特定條件下按下主按鈕時關閉ContentDialog?例如,假設你有一個布爾值。當他們點擊主鍵時,我只想讓ContentDialog關閉if(done == true)。這可能嗎?如何防止在WP8中按下按鈕時關閉ContentDialog
XAML:
<ContentDialog
...
Closing="ContentDialog_Closing">
C#:
private async void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
{
if (!CanClose)
args.Cancel = true;
}