Bookmark and Share Share...    Subscribe to this feed Feed   About me...


Themes in WPF

Introduction

This article will follow soon...

How to use specific Windows theme in a WPF application

WPF includes all common Windows themes. By default WPF loads the current Windows theme as your default style-set. But you can override these styles by loading a specific theme. To do this you first have to add an reference to the style assembly you like to use and second you need to merge the theme resource dictionary into your app resources. This overrides the default style-set that has been loaded by WPF.

The following exmple shows how to load the Windows Vista Aero theme.

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



 Comments on this article

Show all comments
XAML Templates
Commented on 24.March 2009
At http://www.xamltemplates.net you can find themes for WPF and soon for Silverlight 3.0
Hansani
Commented on 18.August 2009
I tried out the coding above. But is indicates an error "The attachable property 'Resources' was not found in type App" Please help me to solve this problem.
Savinda
Commented on 26.August 2009
This code isn't working
Charles...
Commented on 28.August 2009
You have to open App.xaml and place the code like this:
<Application.Resources>
<ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35,
ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />
</Application.Resources>
anilkumar
Commented on 19.September 2009
I have applied the above code in App.xml but still it is not working pls help me
sunil
Commented on 29.September 2009
I think it should be like this

<Application>

<Application.Resources>

<ResourceDictionary Source="/PresentationFramework.Aero, Version=3.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35,
ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />
</Application.Resources>
</Application>
DontYou
Commented on 2.November 2009
Make sure that you have Win Vista or 7.
Cuz, I don't think it works with OS < Vista.
Question
Commented on 3.November 2009
Intentionally Left Blank
This document root element is not supported by the visual designer ?
why ?
Christian Moser
Commented on 4.November 2009
This error message can have multiple causes. Have a look at this MSDN article, it clearly explains all possible causes: http://msdn.microsoft.com/en-us/library/bb907310.aspx

Greetings
Christian
disappointed
Commented on 18.February 2010
worst \"article\" ever
hi
Commented on 8.April 2010
Check this out http://wpfthemes.codeplex.com/
lan
Commented on 19.April 2010
Hi, The error message maybe because you did not include "PresentationFramework.Aero" to your project reference
marvl
Commented on 19.May 2010
I have seen more crappy articles and more dysfunctional code snippets for Forms/WPF/Silverlight than there are grains of sand on your average beach. Here's yet another one. To the author: if you don't know what your doing (yo don't) how about you STFU?
Joy
Commented on 8.July 2010
Thanks.. good one
Ashwin...
Commented on 23.July 2010
I was quite disappointed with the comments posted here, Christian has a good collection of tutorials/guides in his website. These kind of comments would come only from unprofessional people like you, be advised that you could not get it working only because you are incompetent and not because the guide is faulty. For the record, I could get it working (and I am not a software developer at all). Thank you for the good set of tutorials Christian.

If you were wondering how I got it to work, try adding PresentationFramework.Aero.dll to your project "References" as Ian states [And if you can not get this working, you should quite being an engineer and get a job in a fish market].

Christian, I am sorry about the harsh language used in my comment but people like these get on my nerves.
omer iqbal
Commented on 5.August 2010
christian you have done a good job prepared tutorials for learners i appreciate good job SIR..........
Jim
Commented on 18.August 2010
Anyone who cannot get this to work needs to learn to READ. I'm a total WPF newbie and had no trouble.
Tony Clark
Commented on 19.August 2010
Thanks for the article, really helpful to new users. Since, you are talking about themes, I would like to tell you that there are 7 free themes available at http://www.nukeation.com/free.aspx. I found these themes to be really useful.

Name
E-Mail (optional)
Comment
About Christian Moser