Prism.Wpf + Elysium.Extra

Prism.Wpf + Elysium.Extra

我有两个测试项目:第一个用于 Prism.Wpf,第二个用于 Elysium.Extra。 运行 都很好。但现在我尝试在一个项目中使用 Prism 和 Elysium。

我有 class Shell : Framework.UI.Controls.Window(不是 System.Windows.Window,根据 elysium 的示例)和 xaml: <extra:Window x:Class= ...等等

Bootstrapper 的 CreateShell() 方法有一行:

Container.Resolve<Shell>();

当我 运行 我的应用程序时,此行将控制流传递给 Shell 的构造函数,然后应用程序失败并出现异常:

An exception of type 'System.Windows.ResourceReferenceKeyNotFoundException' occurred in PresentationFramework.dll but was not handled in user code

Additional information: 'Framework.UI.Controls.Window' resource not found.

是否可以将 not System.Windows.Window 用作 Prism 的 shell?或者这不是异常的原因?请帮忙。

您可以将任何自定义 Window 控件与 Prism 一起使用。您的问题是您没有将 App.xaml 和 App.xaml.cs 更改为 ElysiumApplication,这是定义 Window 资源的地方。