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