RadWatermarkTextBox
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:
[TelerikToolboxCategory("Input")]
public class RadWatermarkTextBox : TextBox
Inheritance: objectRadWatermarkTextBox
Derived Classes:
Constructors
Initializes a new instance of the RadWatermarkTextBox class.
public RadWatermarkTextBox()
Fields
AdditionalContentProperty
DependencyProperty
Identifies the AdditionalContent property.
public static readonly DependencyProperty AdditionalContentProperty
AdditionalContentTemplateProperty
DependencyProperty
Identifies the AdditionalContentTemplate property.
public static readonly DependencyProperty AdditionalContentTemplateProperty
CurrentTextProperty
DependencyProperty
Identifies the CurrentText dependency property.
public static readonly DependencyProperty CurrentTextProperty
DisabledBackgroundProperty
DependencyProperty
Identifies the DisabledBackground property.
public static readonly DependencyProperty DisabledBackgroundProperty
HasLabelProperty
DependencyProperty
Identifies the HasLabel dependency property.
public static readonly DependencyProperty HasLabelProperty
IsLabelFloatedProperty
DependencyProperty
Identifies the IsLabelFloated dependency property.
public static readonly DependencyProperty IsLabelFloatedProperty
IsWatermarkVisibleProperty
DependencyProperty
Identifies the IsWatermarkVisible dependency property.
public static readonly DependencyProperty IsWatermarkVisibleProperty
KeepLabelFloatedProperty
DependencyProperty
Identifies the KeepLabelFloated dependency property.
public static readonly DependencyProperty KeepLabelFloatedProperty
LabelProperty
DependencyProperty
Identifies the Label dependency property.
public static readonly DependencyProperty LabelProperty
LabelStyleProperty
DependencyProperty
Identifies the LabelStyle dependency property.
public static readonly DependencyProperty LabelStyleProperty
ReadOnlyBackgroundProperty
DependencyProperty
Identifies the ReadOnlyBackground property.
public static readonly DependencyProperty ReadOnlyBackgroundProperty
SelectionOnFocusProperty
DependencyProperty
Identifies the SelectionOnFocus property.
public static readonly DependencyProperty SelectionOnFocusProperty
WatermarkBehaviorProperty
DependencyProperty
Identifies the WatermarkBehavior property.
public static readonly DependencyProperty WatermarkBehaviorProperty
WatermarkContentProperty
DependencyProperty
Identifies the WatermarkContent dependency property.
public static readonly DependencyProperty WatermarkContentProperty
WatermarkTemplateProperty
DependencyProperty
Identifies the WatermarkTemplate dependency property.
public static readonly DependencyProperty WatermarkTemplateProperty
Properties
Gets or sets an object which is rendered in ContentPresenter in the right part of the control.
public object AdditionalContent { get; set; }
AdditionalContentTemplate
DataTemplate
Gets or sets the DataTemplate used for the AdditionalContent object.
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.
public string CurrentText { get; set; }
DisabledBackground
Brush
Gets a value that specifies the background of the control when in disabled state.
public Brush DisabledBackground { get; set; }
Gets a boolean value indicating whether there is a label.
public bool HasLabel { get; }
Gets a boolean value indicating whether the label is floated.
public bool IsLabelFloated { get; }
Gets a value indicating whether the Watermark is visible or not.
public bool IsWatermarkVisible { get; }
Gets or sets a boolean value indicating whether the label should always stay floated on top.
public bool KeepLabelFloated { get; set; }
LabelStyle
Style
Gets or sets the style of the Label of the RadWatermarkTextBox. This is a dependency property.
public Style LabelStyle { get; set; }
ReadOnlyBackground
Brush
Gets a value that specifies the background of the control when in readonly state.
public Brush ReadOnlyBackground { get; set; }
Specifies the modification over the selection when the control receives focus.
public SelectionOnFocus SelectionOnFocus { get; set; }
Gets a value that specifies when the watermark content of control will be hidden.
public WatermarkBehavior WatermarkBehavior { get; set; }
Gets or sets the content to be shown when the TextBox is empty and not focused.
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.
public DataTemplate WatermarkTemplate { get; set; }
Methods
Indicates that the initialization process for the element is complete.
public override void EndInit()
Called, when the Clear command is invoked.
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.
public override void OnApplyTemplate()
OnCreateAutomationPeer()
AutomationPeer
Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)