在 Windows Phone 8(或 8.1)中,有没有办法防止在某些条件下按下主按钮时 ContentDialog 关闭?例如,假设您完成了一个布尔运算。当他们单击主按钮时,我只希望 ContentDialog 在 (done == true) 时关闭。这可能吗?
XAML:
<ContentDialog
...
Closing="ContentDialog_Closing">
Run Code Online (Sandbox Code Playgroud)
C#:
private async void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
{
if (!CanClose)
args.Cancel = true;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
862 次 |
| 最近记录: |