Table of Contents

Class TextBox

Namespace
Wpf.Ui.Controls
Assembly
Wpf.Ui.dll

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

DependencyProperty

CurrentPlaceholderEnabledProperty

Identifies the CurrentPlaceholderEnabled dependency property.

public static readonly DependencyProperty CurrentPlaceholderEnabledProperty

Field Value

DependencyProperty

IconPlacementProperty

Identifies the IconPlacement dependency property.

public static readonly DependencyProperty IconPlacementProperty

Field Value

DependencyProperty

IconProperty

Identifies the Icon dependency property.

public static readonly DependencyProperty IconProperty

Field Value

DependencyProperty

IsTextSelectionEnabledProperty

Identifies the IsTextSelectionEnabled dependency property.

public static readonly DependencyProperty IsTextSelectionEnabledProperty

Field Value

DependencyProperty

PlaceholderEnabledProperty

Identifies the PlaceholderEnabled dependency property.

public static readonly DependencyProperty PlaceholderEnabledProperty

Field Value

DependencyProperty

PlaceholderTextProperty

Identifies the PlaceholderText dependency property.

public static readonly DependencyProperty PlaceholderTextProperty

Field Value

DependencyProperty

ShowClearButtonProperty

Identifies the ShowClearButton dependency property.

public static readonly DependencyProperty ShowClearButtonProperty

Field Value

DependencyProperty

TemplateButtonCommandProperty

Identifies the TemplateButtonCommand dependency property.

public static readonly DependencyProperty TemplateButtonCommandProperty

Field Value

DependencyProperty

Properties

ClearButtonEnabled

Gets or sets a value indicating whether to enable the clear button.

public bool ClearButtonEnabled { get; set; }

Property Value

bool

CurrentPlaceholderEnabled

Gets or sets a value indicating whether to display the placeholder text.

public bool CurrentPlaceholderEnabled { get; protected set; }

Property Value

bool

Icon

Gets or sets displayed IconElement.

public IconElement? Icon { get; set; }

Property Value

IconElement

IconPlacement

Gets or sets which side the icon should be placed on.

public ElementPlacement IconPlacement { get; set; }

Property Value

ElementPlacement

IsTextSelectionEnabled

Gets or sets a value indicating whether text selection is enabled.

public bool IsTextSelectionEnabled { get; set; }

Property Value

bool

PlaceholderEnabled

Gets or sets a value indicating whether to enable the placeholder text.

public bool PlaceholderEnabled { get; set; }

Property Value

bool

PlaceholderText

Gets or sets placeholder text.

public string PlaceholderText { get; set; }

Property Value

string

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

bool

TemplateButtonCommand

Gets the command triggered when clicking the button.

public IRelayCommand TemplateButtonCommand { get; }

Property Value

IRelayCommand

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 RoutedEventArgs

The RoutedEventArgs that contains the event data.

OnLostFocus(RoutedEventArgs)

Raises the LostFocus event (using the provided arguments).

protected override void OnLostFocus(RoutedEventArgs e)

Parameters

e RoutedEventArgs

Provides 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 TextChangedEventArgs

The arguments that are associated with the TextChanged event.

RevealClearButton()

Reveals the clear button by ShowClearButton property.

protected void RevealClearButton()

SetPlaceholderTextVisibility()

protected void SetPlaceholderTextVisibility()