为什么PopupWindowAction类在Prism 6中的对话框中难以维持模态模式?

时间:2021-07-27 19:37:58

I use PopupWindowAction class for creation of modal dialog windows (customized and predefined) in my Prism 6 WPF modular application with Unity. (I have Windows 10 on my computer and use MS VS 2015 Professional as development environment.) This is for customized modal dialog:

我在使用Unity的Prism 6 WPF模块化应用程序中使用PopupWindowAction类创建模态对话框窗口(自定义和预定义)。 (我的计算机上安装了Windows 10,并使用MS VS 2015 Professional作为开发环境。)这适用于自定义模式对话框:

<i:Interaction.Triggers>
    <prism:InteractionRequestTrigger SourceObject="{Binding LoginConfirmationRequest, Mode=OneWay}">
         <prism:PopupWindowAction IsModal="True" CenterOverAssociatedObject="True">
              <prism:PopupWindowAction.WindowContent>
                    <views:LoginView />
              </prism:PopupWindowAction.WindowContent>
            </prism:PopupWindowAction>
    </prism:InteractionRequestTrigger>
</i:Interaction.Triggers>

Where LoginView is Prism UserControl(WPF) used for representation of login dialog content. XAML below is for predefined dialog:

其中LoginView是Prism UserControl(WPF),用于表示登录对话框内容。下面的XAML用于预定义的对话框:

<i:Interaction.Triggers>
    <prism:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
        <prism:PopupWindowAction IsModal="True" CenterOverAssociatedObject="True"/>
    </prism:InteractionRequestTrigger>
</i:Interaction.Triggers>

But there is a problem: When dialog (indifferently customized or predefined but with IsModal="True" property of PopupWindowAction) is displayed atop Shell and I begin (in order to verify that dialog is modal) perform frequent clicks by left mouse button on Shell area around the dialog then the dialog is going to background and Shell is displaying atop of the dialog. I just notice it not only in my application but also in InteractivityQuickstart example application. Why is this happening? How to set strong modality for customized and predefined dialogs? Please help me.

但是有一个问题:当在Shell上面显示对话框(无差异地自定义或预定义但具有Ismodal =“True”属性的PopupWindowAction)并且我开始(为了验证对话框是模态的)在Shell上执行鼠标左键的频繁点击对话框周围的区域然后对话框将进入后台,Shell将显示在对话框的顶部。我只是注意到它不仅在我的应用程序中,而且在InteractivityQuickstart示例应用程序中。为什么会这样?如何为自定义和预定义的对话框设置强大的模态?请帮帮我。

1 个解决方案

#1


0  

This has been fixed in the latest Pre-release, and the fix will be made available with the next RTM release of Prism 6.2

这已在最新的Pre-release中修复,修复程序将在Prism 6.2的下一个RTM版本中提供

https://github.com/PrismLibrary/Prism/wiki/Release-Notes--Jan-10,-2016#prism-for-wpf-611-pre2

https://github.com/PrismLibrary/Prism/wiki/Release-Notes--Jan-10,-2​​016#prism-for-wpf-611-pre2

The issue was that the window owner was never being set.

问题是窗口所有者从未被设置过。

#1


0  

This has been fixed in the latest Pre-release, and the fix will be made available with the next RTM release of Prism 6.2

这已在最新的Pre-release中修复,修复程序将在Prism 6.2的下一个RTM版本中提供

https://github.com/PrismLibrary/Prism/wiki/Release-Notes--Jan-10,-2016#prism-for-wpf-611-pre2

https://github.com/PrismLibrary/Prism/wiki/Release-Notes--Jan-10,-2​​016#prism-for-wpf-611-pre2

The issue was that the window owner was never being set.

问题是窗口所有者从未被设置过。