使用 WPF Prism,您可以防止两个模块尝试同时使用同一区域吗?

发布于 2024-09-08 16:47:51 字数 268 浏览 0 评论 0原文

这是我正在尝试做的事情的概述。我在 shell 中有一个区域用于应用程序模式对话框。当模块想要启动应用程序模式对话框时,它会将自定义 Lightbox 控件加载到该区域中,并用我想要显示的内容(警告、向导等)填充它。我在 shell 中定义了该区域,因为我认为灯箱背景需要有它来遮挡整个窗口。

我想到的直接情况是,如果两个模块尝试同时使用该区域会发生什么,是否有任何巧妙的方法可以阻止另一个模块访问该区域,直到该区域的当前使用完成之后?

如果有更好的方法来完成我想要的事情,我愿意接受建议。

Here is the overview of what I am trying to do. I have a region in the shell that is used for application modal dialogs. When a module wants to launch an application modal dialog it loads a custom Lightbox control into the region and fills it with the content I want to display (warning, wizards, etc). I have the region defined in the shell because I assume it needs to be there for the lightbox background to block out the whole window.

The immediate situation that comes to mind is what happens if two modules trying to use the region at the same time, is there any prismy way of preventing another module from accessing a region until after the current use of the region is finished?

If there are better ways to accomplish what I want I am open to suggestions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

还不是爱你 2024-09-15 16:47:51

您可以使用 Prism RI 中的 RegionPopupBehavior 来显示对话框,并将对话框的内容设置为区域视图。

您可以在这里阅读更多相关信息: http://compositewpf.codeplex.com/线程/View.aspx?ThreadId=65394

我希望这有帮助。

谢谢,
达米安

You could use the RegionPopupBehavior from the Prism RI to display dialogs and have the dialog's content set as views into regions.

You can read more about that here: http://compositewpf.codeplex.com/Thread/View.aspx?ThreadId=65394.

I hope this helps.

Thanks,
Damian

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文