Class Dropdown
VisualElement to choose an item among a defined list of choices.
Namespace: Unity.Industrial.Forma.StandardUI
Syntax
public class Dropdown : VisualElement, INotifyValueChanged<int>
Constructors
Dropdown()
Declaration
public Dropdown()
Dropdown(String, IList)
Instantiate a new Dropdown visual element.
Declaration
public Dropdown(string label, IList choices = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | label | The given label string value, if any. |
| IList | choices | The list of choices. |
Properties
contentContainer
Declaration
public override VisualElement contentContainer { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
itemsSource
Get or Set the choices list.
Declaration
public IList itemsSource { get; set; }
Property Value
| Type | Description |
|---|---|
| IList |
label
Get or Set the label string value.
Declaration
public string label { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
selectedItem
Returns the selected value stored into the selected visual item.
Declaration
public object selectedItem { get; set; }
Property Value
| Type | Description |
|---|---|
| Object |
value
Get or Set the currently selected index.
Declaration
public int value { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
FromEnum<T>(String)
Special constructor to instantiate a Dropdown from an
Declaration
public static Dropdown FromEnum<T>(string label = null)
where T : Enum
Parameters
| Type | Name | Description |
|---|---|---|
| String | label | The label string value, if any. |
Returns
| Type | Description |
|---|---|
| Dropdown | An instance of the Dropdown class. |
Type Parameters
| Name | Description |
|---|---|
| T | The |
Refresh()
Declaration
public void Refresh()
SetValueWithoutNotify(Int32)
Declaration
public void SetValueWithoutNotify(int newSelectedIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | newSelectedIndex |