Class TextBox
- Namespace
- Tudormobile.Wpf.Behaviors
- Assembly
- Tudormobile.WpfControls.dll
Provides attached properties and behaviors for a TextBox control, including glyph adorners, placeholder text, and auto-select functionality.
public class TextBox : Behavior<TextBox>
- Inheritance
-
TextBox
- Inherited Members
Methods
GetAutoComplete(DependencyObject)
Gets the value of the AutoComplete attached property for the specified TextBox. The value can be a string, enum, or any IEnumerable. Typically, this property is data bound to provide dynamic auto-completion suggestions.
public static object? GetAutoComplete(DependencyObject obj)
Parameters
objDependencyObjectThe dependency object on which to set the AutoComplete property. Cannot be null. Must be a TextBox.
Returns
- object
The current value of the AutoComplete property attached property, or null if the property is not set.
Remarks
The AutoComplete property provides auto-completion data for the associated text box. Any IEnumerable can be used as the source for auto-completion suggestions. Alternatively, a string can be provided, which will be split into individual suggestions based on a default separator character of '|'. To provide a custom separator, use the surround the text with the separator you want to use, for example: ";item1;item2;item3;". If an Enum is used, the names of the enum values will be used as suggestions.
GetAutoSelect(DependencyObject)
Gets the value of the AutoSelect attached property for the specified DependencyObject.
public static bool GetAutoSelect(DependencyObject obj)
Parameters
objDependencyObjectThe object from which to read the property value.
Returns
- bool
trueif auto-select is enabled; otherwise,false.
GetGlyph(DependencyObject)
Gets the value of the Glyph attached property for the specified DependencyObject.
public static string? GetGlyph(DependencyObject obj)
Parameters
objDependencyObjectThe object from which to read the property value.
Returns
- string
The glyph string value.
GetPlaceholderText(DependencyObject)
Gets the value of the PlaceholderText attached property for the specified DependencyObject.
public static string? GetPlaceholderText(DependencyObject obj)
Parameters
objDependencyObjectThe object from which to read the property value.
Returns
- string
The placeholder text string value.
SetAutoComplete(DependencyObject, object?)
Sets the value of the AutoComplete property on the specified dependency object. Can be a string, enum, or any IEnumerable. Typically, this property is data bound to provide dynamic auto-completion suggestions.
public static void SetAutoComplete(DependencyObject obj, object? value)
Parameters
objDependencyObjectThe dependency object on which to set the AutoComplete property. Cannot be null. Must be a TextBox.
valueobjectThe value to set for the AutoComplete property. Can be null.
Remarks
The AutoComplete property provides auto-completion data for the associated text box. Any IEnumerable can be used as the source for auto-completion suggestions. Alternatively, a string can be provided, which will be split into individual suggestions based on a default separator character of '|'. To provide a custom separator, use the surround the text with the separator you want to use, for example: ";item1;item2;item3;". If an Enum is used, the names of the enum values will be used as suggestions.
SetAutoSelect(DependencyObject, bool)
Sets the value of the AutoSelect attached property for the specified DependencyObject.
public static void SetAutoSelect(DependencyObject obj, bool value)
Parameters
objDependencyObjectThe object on which to set the property value.
valuebooltrueto enable auto-select; otherwise,false.
SetGlyph(DependencyObject, string?)
Sets the value of the Glyph attached property for the specified DependencyObject.
public static void SetGlyph(DependencyObject obj, string? value)
Parameters
objDependencyObjectThe object on which to set the property value.
valuestringThe glyph string value to set.
SetPlaceholderText(DependencyObject, string?)
Sets the value of the PlaceholderText attached property for the specified DependencyObject.
public static void SetPlaceholderText(DependencyObject obj, string? value)
Parameters
objDependencyObjectThe object on which to set the property value.
valuestringThe placeholder text string value to set.