开发者

WPF Windows from assembly being 'themed' by host app

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?


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:

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜