Windows 7 theme for WPF? Windows 7 theme for WPF? windows windows

Windows 7 theme for WPF?


WPF comes with the standard Windows themes on all Windows versions. For example, you can have the Aero theme (which Vista and Windows 7 use) on Windows XP with the following steps:

  1. Add PresentationFramework.Aero to your application's references list as a requires
  2. Edit your App.xaml

from this

<Application.Resources>  <!-- Your stuff here --></Application.Resources>

to this

<Application.Resources>  <ResourceDictionary>    <!-- Put your stuff here instead -->    <ResourceDictionary.MergedDictionaries>      <ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml"/>    </ResourceDictionary.MergedDictionaries>  </ResourceDictionary></Application.Resources> 

Source: http://mrpmorris.blogspot.com/2008/05/using-vista-aero-theme-in-xp-wpf-apps.html

Other alternatives below. Be sure to add the corresponding assembly to your application's reference list as a requires.

<ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml"/><ResourceDictionary Source="/PresentationFramework.Classic;component/themes/Classic.xaml"/><ResourceDictionary Source="/PresentationFramework.Royale;component/themes/Royale.NormalColor.xaml"/><ResourceDictionary Source="/PresentationFramework.Luna.Homestead;component/themes/Luna.Homestead.xaml"/><ResourceDictionary Source="/PresentationFramework.Luna.Metallic;component/themes/Luna.Metallic.xaml"/><ResourceDictionary Source="/PresentationFramework.Zune;component/themes/Zune.NormalColor.xaml"/>


One addition to Lars' answer and DanM's update:

When deploying, you must add the aero Dll to the installation dir.

You can do it by going to the properties of PresentationFramework.Aero you added to the references and setting CopyLocal=True . Then, you'll have to go to whatever deployment tool you're using (I love WIX...) and add it to the list of deployed files.


Go to your solution/project properties, and under "References" you will be able to add a reference to PresentationFramework.Aero...Apply it in your code and it should work nicely

I hope my answer helps you