0
抵消我已在窗口定義AdornerDecorator爲WPF窗口的變化控制
<Window x:Class="MyWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Style="{StaticResource ShapedWindow}"
Title="Title">
<Grid Name="grid1" />
</Window>
用下面的風格和模板定義
<Style x:Key="ShapedWindow" TargetType="{x:Type Window}">
<Setter Property="AllowsTransparency" Value="True"></Setter>
<Setter Property="WindowStyle" Value="None"></Setter>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="MinWidth" Value="300" />
<Setter Property="MinHeight" Value="300" />
<Setter Property="Template" Value="{StaticResource ShapedWindowTemplate}"></Setter>
</Style>
<ControlTemplate x:Key="ShapedWindowTemplate" TargetType="{x:Type Window}">
<!--<AdornerDecorator>
<ContentPresenter />
</AdornerDecorator>-->
</ControlTemplate>
產生以下窗口在設計以下
當我刪除來自模板定義的評論網格似乎沒有呈現在相同的位置?我在這裏錯過了什麼?
它在運行時如何顯示? – 2011-02-05 21:08:41