无法在资源字典中为路径设置样式

时间:2011-06-28 11:31:11

标签: silverlight-4.0 resourcedictionary

我无法设置资源字典的路径....

<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary  Source="/SilverlightOrganization;component/Styles/BlueStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

我也试过了......

   <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary  Source="Styles/BlueStyles.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>

请问有什么问题帮助....

enter image description here

1 个答案:

答案 0 :(得分:0)

我相信您需要在ResourceDictionary标记中添加一个键:

<UserControl.Resources>
    <ResourceDictionary x:Key="ucRescDict">
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/PDMC;component/Views/XamlResources/AppFormsStyle.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
    <converters:InvertBooleanToVisibilityConverter x:Key="invertBoolToVisibility" />
</UserControl.Resources>