WPF倒影效果
<TextBox Height="40" Width="200" Text="Hello WPF" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBox.Style>
<Style TargetType="TextBox">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="FontFamily" Value="Microsoft Yahei"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Foreground" Value="Red"/>
<Setter Property="MinHeight" Value="70"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Grid Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="1"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border x:Name="bd" Grid.Row="0" BorderBrush="LightGray" BorderThickness="1" CornerRadius="5">
<ScrollViewer x:Name="PART_ContentHost" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Border>
<Rectangle Grid.Row="2" RenderTransformOrigin="1,0.5">
<Rectangle.Fill>
<VisualBrush Visual="{Binding ElementName=bd}"/>
</Rectangle.Fill>
<Rectangle.RenderTransform>
<ScaleTransform ScaleY="-1"/>
</Rectangle.RenderTransform>
<Rectangle.OpacityMask>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Transparent" Offset="0.2"/>
<GradientStop Color="Red" Offset="1"/>
</LinearGradientBrush>
</Rectangle.OpacityMask>
</Rectangle>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</TextBox.Style>
</TextBox>