<ControlTemplate x:Key="wtbTemplate" TargetType="WatermarkedTextBox">
<Grid x:Name="RootElement" >
<Grid.Resources>
<Storyboard x:Key="Disabled State">
<DoubleAnimation Storyboard.TargetName="DisabledVisual"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="ELEMENT_Content"
Storyboard.TargetProperty="Opacity"
To="0.5" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="WatermarkElement"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.0"/>
</Storyboard>
<Storyboard x:Key="Disabled Watermarked State">
<DoubleAnimation Storyboard.TargetName="DisabledVisual"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="ELEMENT_Content"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="WatermarkElement"
Storyboard.TargetProperty="Opacity"
To="0.5" Duration="0:0:0.0"/>
</Storyboard>
<Storyboard x:Key="Normal State">
<DoubleAnimation Storyboard.TargetName="ELEMENT_Content"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="WatermarkElement"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.0"/>
</Storyboard>
<Storyboard x:Key="Focused State">
<DoubleAnimation Storyboard.TargetName="FocusVisual"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.1"/>
<DoubleAnimation Storyboard.TargetName="ELEMENT_Content"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="WatermarkElement"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.0"/>
</Storyboard>
<Storyboard x:Key="MouseOver State">
<!--<DoubleAnimation Storyboard.TargetName="FocusVisual"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.1"/>-->
<DoubleAnimation Storyboard.TargetName="MouseOverVisual"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.1"/>
<DoubleAnimation Storyboard.TargetName="ELEMENT_Content"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="WatermarkElement"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.0"/>
</Storyboard>
<Storyboard x:Key="Normal Watermarked State">
<DoubleAnimation Storyboard.TargetName="ELEMENT_Content"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="WatermarkElement"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.0"/>
</Storyboard>
<Storyboard x:Key="MouseOver Watermarked State">
<!--<DoubleAnimation Storyboard.TargetName="FocusVisual"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.1"/>-->
<DoubleAnimation Storyboard.TargetName="MouseOverVisual"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.1"/>
<DoubleAnimation Storyboard.TargetName="ELEMENT_Content"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.0"/>
<DoubleAnimation Storyboard.TargetName="WatermarkElement"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.0"/>
</Storyboard>
</Grid.Resources>
<!-- To get a white background -->
<Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
RadiusX="5" RadiusY="5" Opacity="1" Fill="White"/>
<!-- Simple drop shadow effect on Mouse Over -->
<Grid x:Name="MouseOverVisual" Opacity="0">
<Rectangle Height="10" Width="10" RadiusX="5" RadiusY="5"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
Stroke="Gray" StrokeThickness="4" Margin="0,0,-2,-2">
<Rectangle.Clip>
<RectangleGeometry Rect="4,4,6,6"/>
</Rectangle.Clip>
</Rectangle>
<Rectangle Width="3" RadiusX="2" RadiusY="2" HorizontalAlignment="Right"
VerticalAlignment="Stretch" Fill="Gray" Margin="0,5,-2,3"/>
<Rectangle Height="3" RadiusX="2" RadiusY="2" HorizontalAlignment="Stretch"
VerticalAlignment="Bottom" Fill="Gray" Margin="5,0,3,-2"/>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="3*"/>
<RowDefinition Height="5*"/>
</Grid.RowDefinitions>
<!-- Top of tag-->
<Rectangle Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
RadiusX="5" RadiusY="5" Fill="LimeGreen"/>
<Rectangle Grid.Row="0" Height="5" HorizontalAlignment="Stretch"
VerticalAlignment="Bottom" Fill="LimeGreen"/>
<TextBlock Grid.Row="0" Text="Hello, my name is ..." FontFamily="Comic Sans MS"
FontSize="24" Foreground="White" VerticalAlignment="Center" Margin="5,0,0,0"/>
<!-- Bottom of tag where the name is typed -->
<Border x:Name="ELEMENT_Content" Grid.Row="1" Background="Transparent"
BorderBrush="Transparent" BorderThickness="0" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" Padding="10,0,0,0"/>
<ContentControl
Grid.Row="1"
x:Name="WatermarkElement"
IsTabStop="False"
IsHitTestVisible="False"
Content="{TemplateBinding Watermark}"
Foreground="Gray"
Background="{TemplateBinding Background}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontStretch="{TemplateBinding FontStretch}"
FontStyle="{TemplateBinding FontStyle}"
FontWeight="{TemplateBinding FontWeight}"
Padding="10,0,0,0"/>
</Grid>
<!-- A nice black border on top of it all-->
<Rectangle StrokeThickness="2" Stroke="Black" Fill="Transparent" RadiusX="5" RadiusY="5"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
<!-- Show a star if the control has focus -->
<Polygon x:Name="FocusVisual" Stroke="Blue" StrokeThickness="1.0" Fill="Blue" Opacity="0"
Stretch="Fill" Height="50" Width="50"
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,-25,-20,0"
Points="317.667,129.333 308.043,112.31 320.505,97.2405 301.341,101.133 290.86,84.6235 288.64,104.052 269.7,108.919 287.492,117.034 286.267,136.551 299.483,122.138 317.667,129.333"/>
<!-- Put a semi-transparent mask over the control if it is disabled -->
<Rectangle x:Name="DisabledVisual" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
RadiusX="5" RadiusY="5" Opacity="0" Fill="#55AAAAAA"/>
</Grid>
</ControlTemplate>