gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 04:21:53 25 4
gpt4 key购买 nike

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

最佳答案

XAML:

<ContentDialog
...
Closing="ContentDialog_Closing">

C#:

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

关于windows-phone-8 - 如何防止 ContentDialog 在 WP8 中按下按钮时关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29806458/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com