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 =)

[958 byte] By [newbie_lg] at [2008-1-10]
# 1

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.

HuaWang at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 2
oh ok that helps thank you =)
newbie_lg at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 3
hmmm...it is a little bit complicated for someone who is just learning wpf. but it is good to know so i can start taking it seriously
newbie_lg at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 4
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.
MikeBrown at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 5
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.

PatrickSears at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 6
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.
MikeBrown at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 7
Ohhh yes that's what I was talking about. Then my original warning stands Smile
PatrickSears at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 8

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.

newbie_lg at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 9

anyone knows where i can find an example of a simple customize WPF frame. i just want it to look better than Win 98 look.

newbie_lg at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 10

There's a quite nice one here:

http://pavanpodila.spaces.live.com/blog/cns!9C9E888164859398!345.entry

Make sure to note my discussion of the associated issues with WindowsFormsHost. In short, setting AllowsTransparency=True causes any controls mounted to WindowsFormsHost to not paint. That's the problem you're having.

There IS a way around that problem, which essentially amounts to keeping a floating window above your application, so that your controls aren't really part of the window, they're above it.

My discussion with Peter Antal about that issue (which is also linked to in my comments in the above blog post) is here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2055201&SiteID=1

PatrickSears at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 11
thanks
newbie_lg at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 12

Actually there is a hotfix for the performance issue on XP. Nathan Dunlap linked to it in his blog. So if you happen to have this issue with your app, there you go.

It seems that there will be an update down the road that includes this fix.

MikeBrown at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...
# 13
Mike -

Oh. My. God. [drools] I can't wait to get home and install the hotfix and try it out!! Smile Thanks!

PatrickSears at 2007-10-3 > top of Msdn Tech,Visual Studio Orcas,Windows Presentation Foundation (WPF)...

Visual Studio Orcas

Site Classified