我有两个字典的问题:的XAML MergedDictionaries不能找到eachothers资源
<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属性= “背景” 的价值....产生错误)
<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>
如果我把它们放在它的作品,有什么建议相同的字典?
所以你想循环你的引用循环依赖? –
不是循环的,而是一种依赖方式 –