-
问题:我的项目必须要运行在 WinForm 程序框架内,我在里面嵌套了一个 WPF 程序,像引入 HandyControl 控件,但是我发现一直无法结局引入报错问题
Application.Current.Resources.MergedDictionaries.Add((ResourceDictionary)Application.LoadComponent(new Uri("/Plugin.Demo;component/styles/Generic.xaml", UriKind.Relative)));
var app = Application.Current.Resources.MergedDictionaries;
//第一种
var rDic = new System.Windows.ResourceDictionary();
rDic.Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml", UriKind.Absolute);
app.Add(rDic);
//第二种
app.Add((ResourceDictionary)Application.LoadComponent(new Uri("/HandyControl;component/Themes/SkinDefault.xaml", UriKind.Relative)));
//第三种
app.Add((ResourceDictionary)Application.LoadComponent(new Uri("@/HandyControl;component/Themes/SkinDefault.xaml", UriKind.Relative))); |
Beta Was this translation helpful? Give feedback.
Answered by
ZGGSONG
Dec 8, 2022
Replies: 1 comment
-
我找到原因了,因为这个项目不是启动项目,我同时在启动项目里引入了之后就可以了,而且代码的方式好像只能使用相对路径引入 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ZGGSONG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我找到原因了,因为这个项目不是启动项目,我同时在启动项目里引入了之后就可以了,而且代码的方式好像只能使用相对路径引入