0
我需要使我的WPF桌面应用程序可用于从WinForms应用程序启动。WPF应用程序:从WinForms应用程序启动时缺少资源
但是,我使用第三方控件(例如来自Telerik),并且只有在将所有相同的引用DLL复制到启动WPF应用程序的WinForms应用程序时才能启动应用程序。
异常始终是无法找到与application.xaml关联的文件或相关文件。推测是因为正在执行装配。
我不允许添加对启动WPF应用程序的WinForms应用程序的引用,所以我如何强制我的WPF应用程序在正确的位置查找?
它在这里也是我的主窗口的资源部分,发生的问题:
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/System.Windows.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Input.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Data.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
<ResourceDictionary Source="/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
非常感谢。
感谢您的及时回复。这对确定地知道是有用的,但在这种情况下,WPF应用程序可以通过COM类启动,所以我没有这个功能。 我想尝试在WPF应用程序的构造函数中强制执行此操作,或者在可能的情况下直接在xaml中直接指定。 – miriyo