New to Telerik UI for WPFStart a free 30-day trial

Represents a customizable TextBox control that displays watermark text and allows for additional label functionality. The RadWatermarkTextBox includes properties for defining and styling a label, managing the visibility of watermark content based on the focused state, and provides dependency properties for maintaining text, selection behavior, and additional content. It features animations for label transitions and supports themes for visual customization. This control is designed to enhance user experience by providing contextual information and interaction cues when input fields are empty or untitled.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
[TelerikToolboxCategory("Input")]
public class RadWatermarkTextBox : TextBox

Inheritance: objectRadWatermarkTextBox

Derived Classes: RadPasswordBox

Constructors

Initializes a new instance of the RadWatermarkTextBox class.

C#
public RadWatermarkTextBox()

Fields

AdditionalContentProperty

DependencyProperty

Identifies the AdditionalContent property.

C#
public static readonly DependencyProperty AdditionalContentProperty

Identifies the AdditionalContentTemplate property.

C#
public static readonly DependencyProperty AdditionalContentTemplateProperty

CurrentTextProperty

DependencyProperty

Identifies the CurrentText dependency property.

C#
public static readonly DependencyProperty CurrentTextProperty

DisabledBackgroundProperty

DependencyProperty

Identifies the DisabledBackground property.

C#
public static readonly DependencyProperty DisabledBackgroundProperty

HasLabelProperty

DependencyProperty

Identifies the HasLabel dependency property.

C#
public static readonly DependencyProperty HasLabelProperty

IsLabelFloatedProperty

DependencyProperty

Identifies the IsLabelFloated dependency property.

C#
public static readonly DependencyProperty IsLabelFloatedProperty

IsWatermarkVisibleProperty

DependencyProperty

Identifies the IsWatermarkVisible dependency property.

C#
public static readonly DependencyProperty IsWatermarkVisibleProperty

KeepLabelFloatedProperty

DependencyProperty

Identifies the KeepLabelFloated dependency property.

C#
public static readonly DependencyProperty KeepLabelFloatedProperty

LabelProperty

DependencyProperty

Identifies the Label dependency property.

C#
public static readonly DependencyProperty LabelProperty

LabelStyleProperty

DependencyProperty

Identifies the LabelStyle dependency property.

C#
public static readonly DependencyProperty LabelStyleProperty

ReadOnlyBackgroundProperty

DependencyProperty

Identifies the ReadOnlyBackground property.

C#
public static readonly DependencyProperty ReadOnlyBackgroundProperty

SelectionOnFocusProperty

DependencyProperty

Identifies the SelectionOnFocus property.

C#
public static readonly DependencyProperty SelectionOnFocusProperty

WatermarkBehaviorProperty

DependencyProperty

Identifies the WatermarkBehavior property.

C#
public static readonly DependencyProperty WatermarkBehaviorProperty

WatermarkContentProperty

DependencyProperty

Identifies the WatermarkContent dependency property.

C#
public static readonly DependencyProperty WatermarkContentProperty

WatermarkTemplateProperty

DependencyProperty

Identifies the WatermarkTemplate dependency property.

C#
public static readonly DependencyProperty WatermarkTemplateProperty

Properties

Gets or sets an object which is rendered in ContentPresenter in the right part of the control.

C#
public object AdditionalContent { get; set; }

Gets or sets the DataTemplate used for the AdditionalContent object.

C#
public DataTemplate AdditionalContentTemplate { get; set; }

Gets or sets the text of the TextBox. This property is meant to be used for TwoWay binding in order to be updated on each change of the text and not when the focus is lost.

C#
public string CurrentText { get; set; }

Gets a value that specifies the background of the control when in disabled state.

C#
public Brush DisabledBackground { get; set; }

Gets a boolean value indicating whether there is a label.

C#
public bool HasLabel { get; }

Gets a boolean value indicating whether the label is floated.

C#
public bool IsLabelFloated { get; }

Gets a value indicating whether the Watermark is visible or not.

C#
public bool IsWatermarkVisible { get; }

Gets or sets a boolean value indicating whether the label should always stay floated on top.

C#
public bool KeepLabelFloated { get; set; }

Gets or sets the text used as a label.

C#
public string Label { get; set; }

Gets or sets the style of the Label of the RadWatermarkTextBox. This is a dependency property.

C#
public Style LabelStyle { get; set; }

Gets a value that specifies the background of the control when in readonly state.

C#
public Brush ReadOnlyBackground { get; set; }

Specifies the modification over the selection when the control receives focus.

C#
public SelectionOnFocus SelectionOnFocus { get; set; }

Gets a value that specifies when the watermark content of control will be hidden.

C#
public WatermarkBehavior WatermarkBehavior { get; set; }

Gets or sets the content to be shown when the TextBox is empty and not focused.

C#
public object WatermarkContent { get; set; }

WatermarkTemplate

DataTemplate

Gets or sets the template for presenting the content, shown when the TextBox is empty and not focused.

C#
public DataTemplate WatermarkTemplate { get; set; }

Methods

Indicates that the initialization process for the element is complete.

C#
public override void EndInit()

Called, when the Clear command is invoked.

C#
protected virtual void HandleClear()

When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate(). In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks.

C#
public override void OnApplyTemplate()

Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

C#
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters:eDependencyPropertyChangedEventArgs