views:

283

answers:

1

Is there a way to make a WPF element use (explicitly or implicitly) the resources located in themes even if app.xaml provides resources with the same 'key'-s?

I have all of the default controls restyled, and all those styles are merged to the app's ResourceDictionary. Now I have one single XAML file that has a single element which I'd like to be styled using system's defaults. Is it possible?

+1  A: 

I've found a solution.

I can apply system theme for that single element in the resource, something like this:

<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>                
        <ResourceDictionary 
            Source="/PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component\themes/aero.normalcolor.xaml" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
arconaut