Watermark in UWP AutoComplete (SfTextBoxExt)

10 May 20213 minutes to read

The control will prompt the user with some information, when it is not in focus and contains an empty string.

Using the Watermark

Watermark property allows the users to specify some information, when the text is empty. For illustration let us create a simple SfTextBoxExt, where the user is asked to enter names separated by a comma,

  • xaml
  • Watermark


    The Watermark property is of the object type so any Framework elements can be hosted as Watermark content. Below example shows how to host an image and text as Watermark content.

  • xaml
  • <editors:SfTextBoxExt HorizontalAlignment="Center" 
                    <StackPanel Orientation="Horizontal">
                        <Image Source="Windows 8.png" Stretch="None" Margin="2"/>
                        <TextBlock Text="Search Windows" Opacity="0.5" Margin="5 2"/>


    Using the Watermark template

    Any business object can be bound to the Watermark property and that object can be decorated by applying the WatermarkTemplate property.

  • xaml
  • <editors:SfTextBoxExt HorizontalAlignment="Center" 
                                Watermark="{Binding Person}">
                        <TextBlock Text="{Binding}" Opacity="0.5"/>