复合 WPF 问题 - View 和 Presenter 构造函数不运行

发布于 2024-08-16 00:42:37 字数 432 浏览 1 评论 0原文

请考虑以下位置的 VS 2008 .NET 3.5 SP 1 解决方案:

http://www.theese.com /SolutionName.zip

此应用程序使用 Microsoft 的 Composite WPF(又名 Prism)架构。这是一个非常简单的应用程序,演示了我遇到的问题。我有一个模块和一个视图。该视图被映射到唯一的区域。由于某种原因,尽管模块确实加载了,但视图的构造函数没有运行(关联演示者的构造函数也没有运行)。

如果应用程序按预期运行,您将看到一个白色屏幕,中间有一个红色 TextBlock,其中包含文本“ModuleNameView”。相反,仅出现白屏。有人能看到我做错了什么吗?

谢谢, 戴夫

Please consider the VS 2008 .NET 3.5 SP 1 solution at this location:

http://www.theese.com/SolutionName.zip

This application uses Microsoft's Composite WPF (aka Prism) architecture. It is a very simple app that demonstrates a problem I'm having. I have one module with one view. That view gets mapped to the one and only region. For some reason, the view's constructor does not run (nor does the constructor of the associated presenter), though the module does load.

If the application were functioning as intended, you'd see a white screen with a red TextBlock in the middle containing the text "ModuleNameView". Instead, only a white screen appears. Can anybody see what I am doing wrong?

Thanks,
Dave

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

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

发布评论

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

评论(1

唐婉 2024-08-23 00:42:37

在您的 shell.xaml 中,您有一个错误:

  cal:RegionManager.RegionName="x:Static local:RegionNames.MainRegion}"

应该是

  cal:RegionManager.RegionName="{x:Static local:RegionNames.MainRegion}"

[注意区域名称开头缺少“{”。这使它对我有用。

In your shell.xaml, you had a bug:

  cal:RegionManager.RegionName="x:Static local:RegionNames.MainRegion}"

should be

  cal:RegionManager.RegionName="{x:Static local:RegionNames.MainRegion}"

[notice the missing '{' at the beginning of your region name. That made it work for me.

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