使用视觉画笔作为矩形的填充。
您将无法与之交互......但这就是任务栏上预览缩略图的完成方式。
<Grid HorizontalAlignment="Left" Name="A" Height="100" Width="100">
<Grid.Background>
<SolidColorBrush Opacity="0" Color="White"/>
</Grid.Background>
<!-- Contents -->
</Grid>
<Rectangle Name="RA" VerticalAlignment="Top" Width="100" Height="100" HorizontalAlignment="Left" Stroke="Black">
<Rectangle.Fill>
<!-- Creates the reflection. -->
<VisualBrush AutoLayoutContent="True" Visual="{Binding ElementName=A}" ViewboxUnits="RelativeToBoundingBox" ViewportUnits="RelativeToBoundingBox" Stretch="Fill" AlignmentX="Left" AlignmentY="Top" Viewport="0,0,1,1" Viewbox="0,0,1,1" TileMode="None">
</VisualBrush>
</Rectangle.Fill>
</Rectangle>
要进行交互,您必须将所有属性绑定到相同的屏幕,并使用布局转换来缩小它。
<StackPanel>
<Grid>
<TextBox Name="A"/>
</Grid>
<Grid>
<Grid.LayoutTransform>
<ScaleTransform CenterX=".5" CenterY=".5" ScaleX=".25" ScaleY=".25"/>
</Grid.LayoutTransform>
<TextBox Name="B" Text="{Binding ElementName=A, Path=Text, UpdateSourceTrigger=PropertyChanged}"/>
</Grid>
</StackPanel>