开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜