Class TextField
Text Field UI element.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class TextField : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IInputElement<string>, IValidatableElement<string>, INotifyValueChanging<string>, INotifyValueChanged<string>
Constructors
TextField()
Default constructor.
Declaration
public TextField()
TextField(string)
Construct a TextField with a predefined text value.
Declaration
public TextField(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | A default text value. |
Fields
inputContainerUssClassName
The TextField input container styling class.
Declaration
public static readonly string inputContainerUssClassName
Field Value
Type | Description |
---|---|
string |
inputUssClassName
The TextField input styling class.
Declaration
public static readonly string inputUssClassName
Field Value
Type | Description |
---|---|
string |
leadingContainerUssClassName
The TextField leading container styling class.
Declaration
public static readonly string leadingContainerUssClassName
Field Value
Type | Description |
---|---|
string |
leadingIconUssClassName
The TextField leading icon styling class.
Declaration
public static readonly string leadingIconUssClassName
Field Value
Type | Description |
---|---|
string |
placeholderUssClassName
The TextField placeholder styling class.
Declaration
public static readonly string placeholderUssClassName
Field Value
Type | Description |
---|---|
string |
sizeUssClassName
The TextField size styling class.
Declaration
public static readonly string sizeUssClassName
Field Value
Type | Description |
---|---|
string |
trailingContainerUssClassName
The TextField trailing container styling class.
Declaration
public static readonly string trailingContainerUssClassName
Field Value
Type | Description |
---|---|
string |
trailingIconUssClassName
The TextField trailing icon styling class.
Declaration
public static readonly string trailingIconUssClassName
Field Value
Type | Description |
---|---|
string |
ussClassName
The TextField main styling class.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
string |
Properties
contentContainer
The content container of the TextField.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
invalid
The invalid state of the TextField.
Declaration
public bool invalid { get; set; }
Property Value
Type | Description |
---|---|
bool |
isPassword
Whether the TextField is a password field.
Declaration
public bool isPassword { get; set; }
Property Value
Type | Description |
---|---|
bool |
isReadOnly
Whether the TextField is read-only.
Declaration
public bool isReadOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
leadingElement
The TextField leading element.
Declaration
public VisualElement leadingElement { get; set; }
Property Value
Type | Description |
---|---|
VisualElement |
leadingIconName
The leading icon name.
Declaration
public string leadingIconName { get; set; }
Property Value
Type | Description |
---|---|
string |
maskChar
The TextField mask character.
Declaration
public char maskChar { get; set; }
Property Value
Type | Description |
---|---|
char |
maxLength
The TextField max length.
Declaration
public int maxLength { get; set; }
Property Value
Type | Description |
---|---|
int |
placeholder
The TextField placeholder text.
Declaration
public string placeholder { get; set; }
Property Value
Type | Description |
---|---|
string |
size
The TextField size.
Declaration
public Size size { get; set; }
Property Value
Type | Description |
---|---|
Size |
trailingElement
The TextField trailing element.
Declaration
public VisualElement trailingElement { get; set; }
Property Value
Type | Description |
---|---|
VisualElement |
trailingIconName
The trailing icon name.
Declaration
public string trailingIconName { get; set; }
Property Value
Type | Description |
---|---|
string |
validateValue
The validation function for the TextField.
Declaration
public Func<string, bool> validateValue { get; set; }
Property Value
Type | Description |
---|---|
Func<string, bool> |
value
The TextField value.
Declaration
public string value { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
SetValueWithoutNotify(string)
Set the TextField value without notifying the change.
Declaration
public void SetValueWithoutNotify(string newValue)
Parameters
Type | Name | Description |
---|---|---|
string | newValue | The new value of the TextField. |