显示 StatusBar 时 ContentDialog 消失

ContentDialog disappears when showing StatusBar

我在显示 ContentDialog 时有一个奇怪的行为。当对话框出现在屏幕上并且我向下拖动状态栏时,对话框消失了。

private ContentDialog _connectivityDialog = new ContentDialog { IsPrimaryButtonEnabled = false, IsSecondaryButtonEnabled = false, Title = "Test"};

我在某个地方打电话给 _connectivityDialog.ShowAsync();

我做了一个简单的项目来重现这种行为: https://www.dropbox.com/sh/0a6ad5xtrzii7sx/AADnbF9TGpfJnV9xnVG4FQMJa?dl=0

知道为什么会这样吗?

我在调查另一个问题时找到了解决方案:

后退按钮关闭对话框。

解决方案:

_connectivityDialog.Closing += (sender, args) =>
            {
                args.Cancel = true;
            };

但请注意,Hide()-方法也会受到影响。您可以像 post 这样的解决方法: How to prevent the ContentDialog from closing when home key is pressed in Windows phone 8.1..?