Represents a textbox control that permits the use of a watermark.
The following example shows how to create a simple WatermarkTextBox
<xctk:WatermarkTextBox Watermark="Enter First Name" />
The following example shows how to create a WatermarkTextBox that displays text and an image.
<xctk:WatermarkTextBox>
<xctk:WatermarkTextBox.Watermark>
<StackPanel Orientation="Horizontal">
<Image Source="Contact16.png" Stretch="None" />
<TextBlock Text="Enter First Name" Margin="4,0,0,0" />
</StackPanel>
</xctk:WatermarkTextBox.Watermark>
</xctk:WatermarkTextBox>
The following example shows how to create a WatermarkTextBox that uses a custom WatermarkTemplate.
<xctk:WatermarkTextBox Watermark="Enter First Name">
<xctk:WatermarkTextBox.WatermarkTemplate>
<DataTemplate>
<Border BorderBrush="Green" BorderThickness="1">
<ContentControl Content="{Binding}" Foreground="DarkRed" FontWeight="Bold" Focusable="False" />
</Border>
</DataTemplate>
</xctk:WatermarkTextBox.WatermarkTemplate>
</xctk:WatermarkTextBox>
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2