# Watermark

You can set a watermark content to a **RadMaskedTextInput** control by using the **EmptyContent** and **EmptyContentTemplate** properties. When the **Value** of a **RadMaskedTextInput** control is null or empty the **EmptyContent** will be displayed.

## Using EmptyContent Property

In scenarios, where you want to show custom content, when an empty string is entered, you need to use the **EmptyContent** property.

In the following example, the user is asked to enter four digits:

**Example 1: Defining the RadMaskedTextInput control**

```XAML
<telerik:RadMaskedTextInput Mask="####" />
```

When an empty string is entered, then the default **Placeholder**(the character used to represent the absence of user input in a **RadMaskedInput** control) will be displayed.

![WPF RadMaskedInput Default Placeholder](https://www.telerik.com/products/wpf/documentation/assets/eb760b3328e65fb12c543c7c25cbd7bf/radmaskedtextbox_features_watermark_default.png)

If the **EmptyContent** property is set, then it will be displayed when an empty string is entered.

**Example 2: Setting the EmptyContent property**

```XAML
<telerik:RadMaskedTextInput Mask="####" EmptyContent="Please Enter Four Digits" />
```

![WPF RadMaskedInput Custom Empty Content](https://www.telerik.com/products/wpf/documentation/assets/92b69060ce9295b0eaf619fbe5ea5d29/radmaskedtextbox_features_watermark_customized.png)

The **EmptyContent** property is of type object. Which means that you can set anything you want. For example:

**Example 3: Setting custom RadWatermarkTextBox to the EmptyContent property**

```XAML
<telerik:RadMaskedTextInput Mask="####">
    <telerik:RadMaskedTextInput.EmptyContent>
        <telerik:RadWatermarkTextBox Margin="3,0,0,0" BorderBrush="Transparent">
            <telerik:RadWatermarkTextBox.WatermarkTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Example;component/Images/EURFlag.png" />
                        <TextBlock Margin="3,0,0,0" Text="Please Enter Four Digits" />
                    </StackPanel>
                </DataTemplate>
            </telerik:RadWatermarkTextBox.WatermarkTemplate>
        </telerik:RadWatermarkTextBox>
    </telerik:RadMaskedTextInput.EmptyContent>
</telerik:RadMaskedTextInput>
```

![WPF RadMaskedInput RadWatermarkTextBox as Empty Content](https://www.telerik.com/products/wpf/documentation/assets/f33caeb43fc571545a78da7e4b21b946/radmaskedtextbox_features_watermark_watermarktextbox_default.png)

## Using EmptyContentTemplate Property

Similarly, you can use the **EmptyContentTemplate** property for the same sort of scenarios. Note that in this case you should define a new **DataTemplate** for the **EmptyContentTemplate** property.

**Example 4: Setting custom template to the EmptyContentTemplate property**

```XAML
<telerik:RadMaskedTextInput Mask="####">
    <telerik:RadMaskedTextInput.EmptyContentTemplate>
        <DataTemplate>
            <telerik:RadWatermarkTextBox Margin="3,0,0,0" BorderBrush="Transparent">
                <telerik:RadWatermarkTextBox.WatermarkTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/Example;component/Images/EURFlag.png" />
                            <TextBlock Margin="3,0,0,0"
	                                        Text="Please Enter Four Digits" />
                        </StackPanel>
                    </DataTemplate>
                </telerik:RadWatermarkTextBox.WatermarkTemplate>
            </telerik:RadWatermarkTextBox>
        </DataTemplate>
    </telerik:RadMaskedTextInput.EmptyContentTemplate>
</telerik:RadMaskedTextInput>
```

![WPF RadMaskedInput RadWatermarkTextBox in Empty Content Template](https://www.telerik.com/products/wpf/documentation/assets/f33caeb43fc571545a78da7e4b21b946/radmaskedtextbox_features_watermark_watermarktextbox_customized.png)

> tip You can see a live demo demonstrating the **EmptyContent** property [here](https://demos.telerik.com/silverlight/#MaskedInput/MaskedTextInput).

> tip For more information about the **RadWatermarkTextBox** control, check out the[RadWatermarkTextBox Overview](http://www.telerik.com/help/wpf/radwatermarktextbox-overview.html) topic.

## See Also

* [Getting Started](https://www.telerik.com/products/wpf/documentation/controls/radmaskedinput/getting-started)
* [Common Features](https://www.telerik.com/products/wpf/documentation/controls/radmaskedinput/features/common)
