ResourceDictionary error!

Sep 20, 2010 at 11:57 PM

Hi,

I'm receiving this error:

'The designer does not support loading dictionaries that mix 'ResourceDictionary' items without a key and other items in the same collection.'

 

It occurs in Application.xaml when I try to paste this code:

 <ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Office2010/Blue.xaml"/>

 

How can I get around this? Is there a way I can set a key for the ribbon resourcedictionary?

 

Please reply fast! :)

 

Thanks!

Sep 21, 2010 at 2:49 AM

this must be simple..

Coordinator
Sep 21, 2010 at 4:59 AM

Does your top ResourceDictionaries have an x:Key? You shouldn't typically need an x:Key for an ResourceDictionaries element itself, and the presence of one might be confusing the IDE's XAML loader. Maybe...

Sep 21, 2010 at 6:43 AM
Edited Sep 21, 2010 at 6:44 AM

Thanks for your reply :)

 

Yes, other items in the Application.xaml have an x:key. That is unavoidable.

 

How can I set an x:key for the ribbon resourcedictionary? I've been trying for hours! I can easily SET the x:key of course, but then when I debug it just asks me to set a style (even though i have the resourcedictionary in the app.xaml, it just doesn't recognise it)! I must need to refer to the x:key name somewhere?

Sep 21, 2010 at 10:52 AM

I really can't figure this out - but it must be simple! Help davinci! :)

Coordinator
Sep 21, 2010 at 11:18 AM

Try to add <ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Office2010/Blue.xaml"/> in window's resources. Why are you using x:Key?

Daniel

Sep 21, 2010 at 11:36 AM
Edited Sep 21, 2010 at 11:37 AM

Other elements in Application.xaml use an X:key - as I said that is unavoidable.

I'm considering using x:key in the ribbon resourcedictionary because of the error I outlined above. When I add an x:key to the resourcedictionary there is no longer an error - hence I'm asking how to make it work with the x:key.

 

How would you advise that a fix the error?

Sep 21, 2010 at 1:43 PM

Okay, I've been searching the net for hours and I've found a few links, in which other people have the same error, in a similiar scenario (but not with Fluent Ribbon). Perhaps you can understand them better than me :)

http://stackoverflow.com/questions/2931864/wpf-compile-error-idictionary-must-have-a-key-attribute

http://social.msdn.microsoft.com/forums/en-US/wpf/thread/fef0cfb1-e9df-4c09-9ab1-3249c439336e

 

Please reply quickly.. :)

 

Sep 21, 2010 at 10:56 PM

daniel?

Coordinator
Sep 22, 2010 at 7:52 AM

The first link looks like the answer for you, what's the problem?

Danilel