WPF frame doesnt look like Aero
Hi everyone,
I added this xaml code on app.xaml file :
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionarySource="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
I can see all my controls on the form are aero looking ones but the windows frame (where the application's icon, title, min, max, close button of the form). what am I missing? Thanks alot for any help =)
You cannot style the window frame you refer to using WPF styling. It is a win32 window non client area. WPF only paints the client area. The win32 style are available through Window.WindowStyle property.
However, you can get rid of the non client area by setting the Window.WindowStyle to None and draw a title bar area in WPF yourself.
You can simulate the Aero effect by using transparent windows. Lee Brimelow has some example code showing how to use it on his
website. You have to search to find the actual entry, but it's there.
Mike Brown wrote: |
| You can simulate the Aero effect by using transparent windows. Lee Brimelow has some example code showing how to use it on his website. You have to search to find the actual entry, but it's there. | |
Be careful using that effect on WindowsXP. Using Layered Windows (AllowsTransparency=True in XAML) forces the ENTIRE application to be rendered in software on WindowsXP, causing a massive performance loss.
That said, if you're not going to be doing alot of animation or window resizing, it can be quite beautiful.
Here is the post in question:
http://thewpfblog.com/?cat=13
EDIT:
Actually, nevermind. That particular app uses the DWM in Windows Vista. The application will not run on XP.
No that's not the one. The one I'm referring to, he made almost immediately after the June 2006 WPF CTP was released (that was the first release that had the window transparency). I linked to his
post on my blog. Lee used the window's OnInitialized handler to make it transparent. But you can do it just as fine using XAML.
thanks for your replies. I've started playing around to get a transparent looking form. I have some Windows App controls embeded on my WPF form and these win app controls dont display
I guess I need to learn how to make a customize WPF frame.