我有两个字典的问题:
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles1.xaml"/>
<ResourceDictionary Source="Styles2.xaml"/>
</ResourceDictionary.MergedDictionaries>
当我在第一个字典中设置一个资源时,例如颜色。然后它不会在第二本词典中找到它????
第一的:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Color x:Key="ApplicationPageBackgroundColor">#FFFFFFFF</Color>
<SolidColorBrush x:Key="ApplicationPageBackgroundColorBrush" Color="{StaticResource ApplicationPageBackgroundColor}" />
</ResourceDictionary>
第二:(Setter Property="Background" Value .... 产生错误)
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="LayoutRootStyle" TargetType="Panel">
<Setter Property="Background" Value="{StaticResource ApplicationPageBackgroundColorBrush}" />
</Style>
</ResourceDictionary>
如果我将它们放在同一个字典中,它会起作用,有什么建议吗?