Welcome to MSDN Blogs Sign in | Join | Help

Lester's WPF blog


Simple, easy & beautiful

News

Vista look on Non-Aero themes

the look of apps created on vista is kewl and it would be nice to have the same aero theme as default when apps are run on other themes ... the way to do this is to specify the theme at the root. So it would look something like this.

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

Bear in mind that the syntax uses a strong name URI. This is because the app fails to load the assembly from the GAC; the CLR does not support loading dlls with a partial name from the GAC.

To get the Version, Culture and PulblicKeyToken right go to \windows\assembly and check the values for the corresponding dll.

With the above syntax you can now build apps which look like the media player 11 on XP... have fun coding.

 

Share this post: Email | Digg! | del.icio.us | Reddit | Kick It | Live Favorites

Posted: Wednesday, December 13, 2006 4:07 PM by llester

Comments

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# December 13, 2006 11:42 AM

Krys said:

Ok... but where can we download the DLL "presentationframework.aero.dll"

I m under XP and cannot find this DLL :-(

# December 14, 2006 12:13 PM

llester said:

You need to install .net 3.0 , which includes wpf

# December 14, 2006 2:15 PM

Joy said:

Should I set any other things to get Aero theme on my Win XP? something like setting styles? Or is this tag enough?

Thanks in Advance

# December 15, 2006 9:27 AM

llester said:

the tag is sufficient :)

# December 17, 2006 12:46 PM

david said:

I've tested this, but the results is not here, I work with .NET 3 RTM, VS 2005 Team Suite and extension for WPF/WCF on Windows XP Pro SP2, I've test this piece of code :

"<Window x:Class="avirer.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WPFTestThemes" Height="300" Width="300">

<Window.Resources>

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

</Window.Resources>

<Grid>

<Button Content="Hello" HorizontalAlignment="Center" VerticalAlignment="Center" />

</Grid>

</Window>

"

and the look of vista is not here :( here is a screenshot :

http://medias.neldim.fr/shot1.png

The toolbar is not the same as Windows media player 11 :(

Can someone help me please ?

Regards

David

# December 21, 2006 10:04 AM

Thomas Lebrun said:

Si vous avez déjà regardé Windows Media Player 11 sur Windows XP, vous avez sans doute remarquez ce look

# December 21, 2006 10:22 AM

llester said:

check out if the public key token matches in the GAC... if you are still facing problems post your question on the WPF forum. you will surely be answered :)

# December 22, 2006 10:53 AM

Территория блога said:

Вводное руководство по WPF - Часть I (XAML) Вводное руководство по WPF - Часть II (Layout) Вводное руководство

# October 19, 2008 4:23 PM

Территория блога said:

Вводное руководство по WPF - Часть I (XAML) Вводное руководство по WPF - Часть II (Layout) Вводное руководство

# October 28, 2008 6:02 PM
New Comments to this post are disabled
Page view tracker