Unable to load resources in VS 2010 when the toolkit is referenced

Mar 1, 2010 at 11:47 PM
Edited Mar 2, 2010 at 2:02 AM

'ShinyBlue.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Object reference not set to an instance of an object.

  • VS 2010: RC 1
  • Target: .NET 3.5
  • WPFToolKit: 3.5.40128.1

If I remove the the reference to WPFToolKit, the program works correctly.

I have not been able to reproduce this in VS 2008.

 Any idea why this would happen?

Mar 2, 2010 at 2:10 AM

This is caused by referencing WPFToolKit from a DLL without also referencing it from the EXE.

Mar 7, 2010 at 3:52 PM

Let me understand first... you are referencing this toolkit (even though RC1 has the controls of the toolkit built-in) and are you trying to access the "themes" that are part of the a separate assembly on the toolkit site?

Mar 7, 2010 at 4:39 PM

Correct me if I'm wrong, but I was under the impression that Visual Studio RC 1 doesn't have anything built in. It comes with .NET 4 and that has the controls built in, but as I said in my question I am using .NET 3.5.

I am using a themes file, specifically one that is based on the ShinyBlue.xaml file from this site.

Mar 8, 2010 at 10:46 PM

can you post the xaml you are using to registered this style?


I just tried it and it works.. But if you can show me what you are doing it might help

Mar 8, 2010 at 10:57 PM
                <ResourceDictionary Source="resources/ShinyBlue.xaml" />

here is how I applied it to the application entirely