Wpf 如何合并位于不同文件夹中程序集中的资源词典?
我有一个具有以下文件夹结构的解决方案:Wpf 如何合并位于不同文件夹中程序集中的资源词典?,wpf,Wpf,我有一个具有以下文件夹结构的解决方案: Solution MainApplication MainWindow.xaml SharedResourcesLibrary (Class library project) GlobalResources.xaml SubFolder ControlLibrary (Class library project) MyUserControl.xaml 我需要将GlobalResources.xaml字典合
Solution
MainApplication
MainWindow.xaml
SharedResourcesLibrary (Class library project)
GlobalResources.xaml
SubFolder
ControlLibrary (Class library project)
MyUserControl.xaml
我需要将GlobalResources.xaml字典合并到MainWindow.xaml和MyUserControl.xaml的资源中
我已在MainWindow.xaml中使用以下语法成功地将GlobalResources.xaml合并到MainWindow.xaml中:
<ResourceDictionary Source="/SharedResourcesLibrary;component/GlobalResources.xaml" />
如何正确地将此词典合并到
MyUserControl
中?这似乎只是Visual Studio 2012中的一个问题。我在VisualStudio2010中打开了我的解决方案,设计器可以完美地使用packURI符号。这似乎只是VisualStudio2012中的一个问题。我在VisualStudio2010中打开了我的解决方案,设计器可以完美地使用packURI符号
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/SharedResourcesLibrary;component/GlobalResources.xaml" />
</ResourceDictionary.MergedDictionaries>
An error occurred while finding the resource dictionary "pack://application:,,,/SharedResourcesLibrary;component/GlobalResources.xaml"