WPF: Can you make this resource declaration less verbose?
This works, but I don't think I'm doing it right.
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Aam.Gui;component/AamBlue.xaml" />
<ResourceDictionary>
<gui:RepKeyVal开发者_StackOverflowueConverter x:Key="RepKeyValueConverter"/>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
You can declare resources directly inside the outer ResourceDictionary and save yourself one pair of ResourceDictionary
tags:
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Aam.Gui;component/AamBlue.xaml" />
</ResourceDictionary.MergedDictionaries>
<gui:RepKeyValueConverter x:Key="RepKeyValueConverter"/>
</ResourceDictionary>
</UserControl.Resources>
精彩评论