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