Class Dropdown
Dropdown UI element.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class Dropdown : Picker<DropdownItem, DropdownItem>, IEventHandler, IVisualElementScheduler, IExperimentalFeatures, ITransitionAnimations, ITransform, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<IEnumerable<int>>, IValidatableElement<IEnumerable<int>>, INotifyValueChanged<IEnumerable<int>>, ISizeableElement, IPressable
Constructors
Dropdown()
Default constructor.
Declaration
public Dropdown()
Dropdown(IList, BindItemFunc, BindTitleFunc, int[])
Construct a Dropdown UI element with a provided dynamic collection of items.
Declaration
public Dropdown(IList items, Picker<DropdownItem, DropdownItem>.BindItemFunc bindItemFunc = null, Picker<DropdownItem, DropdownItem>.BindTitleFunc bindTitleFunc = null, int[] defaultIndices = null)
Parameters
Type | Name | Description |
---|---|---|
IList | items | An items collection. |
Picker<Dropdown |
bindItemFunc | The binding function used to populate display data for each item. |
Picker<Dropdown |
bindTitleFunc | The binding function used to populate display data for the title. |
int[] | defaultIndices | The selected index by default. |
Fields
ussClassName
The Dropdown main styling class.
Declaration
public const string ussClassName = "appui-dropdown"
Field Value
Type | Description |
---|---|
string |
Properties
bindTitle
A method that will be called to bind the title.
Declaration
public Picker<DropdownItem, DropdownItem>.BindTitleFunc bindTitle { get; set; }
Property Value
Type | Description |
---|---|
Picker<Dropdown |
Methods
ApplyMultiSelectionMessage(LocalizedTextElement, int)
Apply the Picker localized multi selection message.
Declaration
protected virtual void ApplyMultiSelectionMessage(LocalizedTextElement element, int selectionCount)
Parameters
Type | Name | Description |
---|---|---|
Localized |
element | The Localized |
int | selectionCount | The number of selected items. |
MakeItem()
Default delegate to create a new DropdownItem for any item.
Declaration
protected static DropdownItem MakeItem()
Returns
Type | Description |
---|---|
Dropdown |
A new DropdownItem. |
MakeTitle()
Default delegate to create a new DropdownItem for the title.
Declaration
protected static DropdownItem MakeTitle()
Returns
Type | Description |
---|---|
Dropdown |
A new DropdownItem. |