tags:

views:

16

answers:

1

I have some assemblies that contain WPF windows and code to provide common functionality when working with in-house systems. As an example - browsing a database and selecting an object.

I've integrated this into a third-party WPF app, but the controls in my own assembly are now being "themed" in the style of the host app. For example my buttons appear identical to the square brown versions used by the app.

How can I prevent this and keep the Windows in my assembly using the default Aero look and feel?

A: 

Well, first, if you're forcing the controls to the Aero look-and-feel, your stuff looks wrong on platforms that don't have (or aren't using) Aero =)

If you're wanting to force the look-and-feel to the platform default, then you can merge in the resource dictionary that corresponds to the currently-selected Windows theme. Some relevant links:

http://stackoverflow.com/questions/541468/how-do-i-match-my-controls-styles-to-the-current-theme-wpf

http://arbel.net/blog/archive/2006/11/03/Forcing-WPF-to-use-a-specific-Windows-theme.aspx

FMM