Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the recommended way to skin an entire application in WPF?

Tags:

I want my WPF application to be skinnable, by applying a certain XAML template, and the changes to be application wide, even for dynamic controls or controls that aren't even in the visual/logical tree.

What can I use to accomplish this type of functionality? Are there any good resources or tutorials that show how this specific task can be done?

like image 215
Pop Catalin Avatar asked Sep 23 '08 13:09

Pop Catalin


2 Answers

The basic approach to take is using resources all through your application and dynamically replacing the resources at runtime.

See http://www.nablasoft.com/alkampfer/index.php/2008/05/22/simple-skinnable-and-theme-management-in-wpf-user-interface/ for the basic approach

like image 182
Maurice Avatar answered Oct 01 '22 10:10

Maurice


The replacing of resource will work but I found "structural skinning" to be more powerfull! Read more about it on CodeProject...

http://www.codeproject.com/KB/WPF/podder1.aspx

like image 25
rudigrobler Avatar answered Oct 01 '22 09:10

rudigrobler