So, I found a way to make this work.
You need to use the WPF Shell integration library ( here ) to do the job for you. As written by MS, they fixed (apparently) any problems with P / Invoke code execution.
Thus, it is easy to get a window that does not have Aero glass, resizes around the edges, has a title bar that behaves with Aero snapping, and has a shadow that appears again after min / maxing.
This is the code for my window (note that you need to specify Microsoft.Windows.Shell )
<Window x:Class="MyLibrary.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell" Title="MainWindow" WindowStyle="SingleBorderWindow" ResizeMode="CanResizeWithGrip" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="449" d:DesignWidth="677" Foreground="White" Background="Black"> <shell:WindowChrome.WindowChrome> <shell:WindowChrome CaptionHeight="35" GlassFrameThickness="0,0,0,1" ResizeBorderThickness="5" /> </shell:WindowChrome.WindowChrome> <Grid x:Name="LayoutRoot"> </gGrid> </Window>
<shell:WindowChrome> is the place where you set all the variables to interact with.
CaptionHeight : This is the height of the title CaptionHeight (title), which allows you to use Aero, double-clicking, as usual, in the title bar.GlassFrameThickness : setting this parameter to 0,0,0,1 for some reason removes chrome (glass), preserves a square frame and adds shadows.ResizeBorderThickness : This is the thickness at the edge of the window where you can resize the window.
Other things to consider as you keep the Window.WindowStyle property set to SingleBorderWindow and allow the Shell library to remove the title, buttons, and other chrome.
So, I kind of wasted my generosity, but it seems like a perfectly viable solution that works!
EDIT:
Here is the image of the result: 
I also suggested a sample project http://code.google.com/p/sample-metro-wpf-application/ . This is a MIT license, and people can use it, but they want to.
Alastair Pitts Dec 29 '11 at 7:11 2011-12-29 07:11
source share