Class TextBox
Extended TextBox with additional parameters like PlaceholderText.
public class TextBox : TextBox, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild
- Inheritance
-
TextBox
- Implements
- Derived
- Inherited Members
Constructors
TextBox()
Initializes a new instance of the TextBox class.
public TextBox()
Fields
ClearButtonEnabledProperty
Identifies the ClearButtonEnabled dependency property.
public static readonly DependencyProperty ClearButtonEnabledProperty
Field Value
CurrentPlaceholderEnabledProperty
Identifies the CurrentPlaceholderEnabled dependency property.
public static readonly DependencyProperty CurrentPlaceholderEnabledProperty
Field Value
IconPlacementProperty
Identifies the IconPlacement dependency property.
public static readonly DependencyProperty IconPlacementProperty
Field Value
IconProperty
Identifies the Icon dependency property.
public static readonly DependencyProperty IconProperty
Field Value
IsTextSelectionEnabledProperty
Identifies the IsTextSelectionEnabled dependency property.
public static readonly DependencyProperty IsTextSelectionEnabledProperty
Field Value
PlaceholderEnabledProperty
Identifies the PlaceholderEnabled dependency property.
public static readonly DependencyProperty PlaceholderEnabledProperty
Field Value
PlaceholderTextProperty
Identifies the PlaceholderText dependency property.
public static readonly DependencyProperty PlaceholderTextProperty
Field Value
ShowClearButtonProperty
Identifies the ShowClearButton dependency property.
public static readonly DependencyProperty ShowClearButtonProperty
Field Value
TemplateButtonCommandProperty
Identifies the TemplateButtonCommand dependency property.
public static readonly DependencyProperty TemplateButtonCommandProperty
Field Value
Properties
ClearButtonEnabled
Gets or sets a value indicating whether to enable the clear button.
public bool ClearButtonEnabled { get; set; }
Property Value
CurrentPlaceholderEnabled
Gets or sets a value indicating whether to display the placeholder text.
public bool CurrentPlaceholderEnabled { get; protected set; }
Property Value
Icon
Gets or sets displayed IconElement.
public IconElement? Icon { get; set; }
Property Value
IconPlacement
Gets or sets which side the icon should be placed on.
public ElementPlacement IconPlacement { get; set; }
Property Value
IsTextSelectionEnabled
Gets or sets a value indicating whether text selection is enabled.
public bool IsTextSelectionEnabled { get; set; }
Property Value
PlaceholderEnabled
Gets or sets a value indicating whether to enable the placeholder text.
public bool PlaceholderEnabled { get; set; }
Property Value
PlaceholderText
Gets or sets placeholder text.
public string PlaceholderText { get; set; }
Property Value
ShowClearButton
Gets or sets a value indicating whether to show the clear button when TextBox is focused.
public bool ShowClearButton { get; protected set; }
Property Value
TemplateButtonCommand
Gets the command triggered when clicking the button.
public IRelayCommand TemplateButtonCommand { get; }
Property Value
Methods
HideClearButton()
Hides the clear button by ShowClearButton property.
protected void HideClearButton()
OnClearButtonClick()
Triggered when the user clicks the clear text button.
protected virtual void OnClearButtonClick()
OnGotFocus(RoutedEventArgs)
Invoked whenever an unhandled GotFocus event reaches this element in its route.
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
e
RoutedEventArgsThe RoutedEventArgs that contains the event data.
OnLostFocus(RoutedEventArgs)
Raises the LostFocus event (using the provided arguments).
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
e
RoutedEventArgsProvides data about the event.
OnPlaceholderEnabledChanged()
protected virtual void OnPlaceholderEnabledChanged()
OnTemplateButtonClick(string?)
Triggered by clicking a button in the control template.
protected virtual void OnTemplateButtonClick(string? parameter)
Parameters
parameter
string
OnTextChanged(TextChangedEventArgs)
Is called when content in this editing control changes.
protected override void OnTextChanged(TextChangedEventArgs e)
Parameters
e
TextChangedEventArgsThe arguments that are associated with the TextChanged event.
RevealClearButton()
Reveals the clear button by ShowClearButton property.
protected void RevealClearButton()
SetPlaceholderTextVisibility()
protected void SetPlaceholderTextVisibility()