Can you define a ResourceDictionary.MergedDictionary together with other (local) resources in <Wind
Posted
by Jeremy Holt
on Stack Overflow
See other posts from Stack Overflow
or by Jeremy Holt
Published on 2010-04-23T02:37:04Z
Indexed on
2010/04/23
2:43 UTC
Read the original article
Hit count: 553
wpf
|resourcedictionary
I would like to refer to a MergedDictionary together with locally declared resources in my Windows.Resources. However, I'm getting this error:
"All objects added to an IDictionary must have a Key attribute or some other type of key associated with them."
Is it possible to mix local resources together with imported resources in the same Window.Resources?
The XAML is:
<Window.Resources>
<CollectionViewSource x:Key="cvsData" Source="{Binding Path=Data}">
<CollectionViewSource.GroupDescriptions>
<PropertyGroupDescription PropertyName="Country"/>
</CollectionViewSource.GroupDescriptions>
</CollectionViewSource>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary x:Name="images" Source="pack://application:,,,/CoreWpfControls;component/Images.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
Thanks Jeremy
© Stack Overflow or respective owner