ContentDialog不会在丢失焦点时退出

问题描述:

 private void locationUpdateDialog_LostFocus(object sender, RoutedEventArgs e)
        {
            locationUpdateDialog.Visibility = Visibility.Collapsed;
        }




locationUpdateDialog是一个内容对话框。但是一旦失去焦点,它就不会像以前那样关闭。


locationUpdateDialog is a Content Dialog.However upon loosing focus it is not closed as should have happened.

什么类型的应用程序?请按照
发布指南:主题行标签

您的LostFocus事件是否被调用?

Is your LostFocus event getting called?

ContentDialog是否首先集中注意力?是否失去焦点?

Is the ContentDialog getting focused in the first place? Is it losing focus?

这可能不是您想要的代码,因为您可能希望对焦在对话框上的控件之间移动时保持打开状态。

This probably isn't the code you want, since you probably want the dialog to stay open while the focus moves between controls on the dialog.

根据应用和设备的类型以及ContentDialog的设计方式,重点可能无处可去。 ContentDialogs通常是全屏的。

Depending on the type of app and device and how your ContentDialog is designed there may not be anywhere else for the focus to go. ContentDialogs are often full screen.