Class MaskField
MaskField UI element.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class MaskField : Dropdown, IEventHandler, IVisualElementScheduler, IExperimentalFeatures, ITransitionAnimations, ITransform, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<IEnumerable<int>>, IValidatableElement<IEnumerable<int>>, INotifyValueChanged<IEnumerable<int>>, ISizeableElement, IPressable, IInputElement<int>, IValidatableElement<int>, INotifyValueChanged<int>
Constructors
MaskField()
Default constructor.
Declaration
public MaskField()
MaskField(IList, int, GetDisplayNameDelegate, GetMaskValueDelegate, BindItemFunc, BindTitleFunc)
Constructor with a default mask value.
Declaration
public MaskField(IList sourceItems, int defaultMaskValue = 0, MaskField.GetDisplayNameDelegate getDisplayNameFunc = null, MaskField.GetMaskValueDelegate getMaskValueFunc = null, Picker<DropdownItem, DropdownItem>.BindItemFunc bindItemFunc = null, Picker<DropdownItem, DropdownItem>.BindTitleFunc bindTitleFunc = null)
Parameters
Type | Name | Description |
---|---|---|
IList | sourceItems | The source items collection. |
int | defaultMaskValue | The default value for the field. |
Mask |
getDisplayNameFunc | An optional function to get the display name. |
Mask |
getMaskValueFunc | An optional function to get the mask value. |
Picker<Dropdown |
bindItemFunc | An optional function to bind the item. |
Picker<Dropdown |
bindTitleFunc | An optional function to bind the title. |
Fields
ussClassName
The main styling class for the MaskField.
Declaration
public const string ussClassName = "appui-mask-field"
Field Value
Type | Description |
---|---|
string |
Properties
getDisplayName
Get the display name for a specific index in the source items collection.
Declaration
public MaskField.GetDisplayNameDelegate getDisplayName { get; set; }
Property Value
Type | Description |
---|---|
Mask |
getMaskValue
Get the mask value for a specific index in the source items collection.
Declaration
public MaskField.GetMaskValueDelegate getMaskValue { get; set; }
Property Value
Type | Description |
---|---|
Mask |
validateValue
An optional function to validate the value.
Declaration
public Func<int, bool> validateValue { get; set; }
Property Value
value
The current value of the field.
Declaration
public int value { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
OnPickerItemRemoved(PickerItem, int)
Called when a Picker item is removed.
Declaration
protected override void OnPickerItemRemoved(PickerItem item, int index)
Parameters
Type | Name | Description |
---|---|---|
Picker |
item | The item to remove. |
int | index | The index of the item to remove. |
Overrides
OnPickerItemsCreated()
Called when the Picker items are created.
Declaration
protected override void OnPickerItemsCreated()
Overrides
OnValueSet()
Called when the Picker value is set with or without notifying listeners.
Declaration
protected override void OnValueSet()
Overrides
SetValueWithoutNotify(int)
Set the value of the field without notifying the change.
Declaration
public void SetValueWithoutNotify(int newValue)
Parameters
Type | Name | Description |
---|---|---|
int | newValue | The new value to set. |