WPF compile error “IDictionary must have a Key attribute”

前端 未结 1 1757
暗喜
暗喜 2021-01-13 00:23

I\'ve created control styles I want to use among multiple xaml pages in my WPF app. To do this I created a Resources.xaml and added the styles there.

Then in my pag

相关标签:
1条回答
  • 2021-01-13 00:43

    Are there any other resources defined other than the merged ResourceDictionary in that Page?

    For example, here's a snippet from a Window I created.

    <Window x:Class="SelectionPagePrototype.SelectionPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:SelectionPagePrototype"
        Title="SelectionPage" MinHeight="600" MinWidth="800" Loaded="OnLoaded">
        <Window.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="ImageResourceDictionary.xaml" />
                </ResourceDictionary.MergedDictionaries>
                <local:QuickPickCheckedConverter x:Key="quickPickConverter" />
                <local:BoolToCaptionConverter x:Key="captionConverter" />
                <local:ProductAndImageTypeConverter x:Key="imageConverter" />
            </ResourceDictionary>
        </Window.Resources>
        <Grid> ...
    

    The merged dictionary did not require a key, but the other resources for that Window do.

    0 讨论(0)
提交回复
热议问题