Windows phone 8 如何防止在WP8中按下按钮时关闭ContentDialog

Windows phone 8 如何防止在WP8中按下按钮时关闭ContentDialog,windows-phone-8,Windows Phone 8,在Windows Phone 8(或8.1)中,在某些情况下按下主按钮时,是否有方法防止ContentDialog关闭?例如,假设您完成了布尔运算。当他们单击主按钮时,我只希望ContentDialog在以下情况下关闭(done==true)。这可能吗?XAML: <ContentDialog ... Closing="ContentDialog_Closing"> private async void ContentDialog_Closing(ContentDi

在Windows Phone 8(或8.1)中,在某些情况下按下主按钮时,是否有方法防止ContentDialog关闭?例如,假设您完成了布尔运算。当他们单击主按钮时,我只希望ContentDialog在以下情况下关闭(done==true)。这可能吗?

XAML:

<ContentDialog
    ...
    Closing="ContentDialog_Closing">
private async void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
{
    if (!CanClose)
        args.Cancel = true;
}