Silverlight 4.0 MEF解决方案中资源字典的可用性
我正在创建一个使用MVVM和MEF的Silverlight应用程序。在主项目的app.xml文件中,我指定了资源字典:Silverlight 4.0 MEF解决方案中资源字典的可用性,silverlight-4.0,Silverlight 4.0,我正在创建一个使用MVVM和MEF的Silverlight应用程序。在主项目的app.xml文件中,我指定了资源字典: <Application x:Class="RAP.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:app="clr-names
<Application
x:Class="RAP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:app="clr-namespace:RAP"
xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:Resources="clr-namespace:RAP.Assets.Resources"
Startup="Application_Startup"
UnhandledException="Application_UnhandledException">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Assets/StylesX.xaml"/>
<ResourceDictionary Source="Assets/Styles.xaml"/>
<ResourceDictionary>
<app:ApplicationResources x:Key="ApplicationResources" />
<app:NotOperatorValueConverter x:Key="NotOperatorValueConverter" />
<app:IsNullConverter x:Key="IsNullConverter" />
<Resources:ResourceWrapper x:Key="ResourceWrapper" />
<telerikControls:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<telerikControls:InvertedBooleanToVisibilityConverter x:Key="InvertedBooleanToVisibilityConverter"/>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
在主项目中,对资源字典中项的StaticResource引用可以正确解析,但在动态加载xap的后续项目中,在设计时,StaticResource引用无法解析,并导致xaml设计器加载问题。我认为,通过在主项目的app.xml中指定资源字典,解决方案中的所有项目都可以使用资源字典。我还需要做些什么来将资源字典公开给解决方案的其他项目吗