How do I "merge" or use a system assembly's ResourceDictionary in my generic.xaml?

446 Views Asked by At

I specifically want to be able to leverage some of the system theme templates and definitions (colours and brushes) for my own custom control. I "think" I'm supposed to use the element in my generic.xaml's root element.

Considering I'm supposed to use some kind of path for the "Source" attribute, what would the path look like for "Aero2"?

Is this even accepted use? Am I allowed to use system themes?

Edit: Since this is a common theme of questions, here are a few other references. How can I set a WPF control's color to a system color programmatically, so that it updates on color scheme changes? Get Aero Window Colour

My goal is to use colours as defined in other ResourceDictionaries -- since they don't seem to match the "SystemColors" namespace.

1

There are 1 best solutions below

9
On

See here.

Basically you need this:

<ResourceDictionary
    Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />