【问题标题】:(UWP) How to include a delay before buttons are enabled in a ContentDialog?(UWP) 如何在 ContentDialog 中启用按钮之前包含延迟?
【发布时间】:2019-08-19 10:06:18
【问题描述】:

我有一个系统,其中 ContentDialog 的结果指示过滤器何时切换到化学样品。但是,如果用户立即单击“确定”,则过滤器切换速度太快,系统驻留时间无法恢复到基线。由于 ContentDialog 还提供了一些有用的信息,我想在启用“ok”之前显示 5 秒钟。这种行为类似于用户在 FireFox 中运行下载的可执行文件。在启用“运行”之前有一个小的延迟。如何在 UWP 中完成此操作?

【问题讨论】:

    标签: uwp


    【解决方案1】:

    用户点击ContentDialog按钮后,可以通过args.Cancel屏蔽默认关机行为。

    private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
    {
        args.Cancel = true;
        // do somethings
        this.Hide();
    }
    

    最好的问候。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-27
      • 1970-01-01
      • 2015-04-16
      • 2017-08-17
      • 1970-01-01
      相关资源
      最近更新 更多