Class Dropdown
A Selectable<T> that represents UnityEngine.UI.Dropdown.
Inherited Members
Namespace: Mux.Markup
Assembly: Mux.Markup.UI.dll
Syntax
public class Dropdown : Selectable<UnityEngine.UI.Dropdown>
Examples
<m:RectTransform
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:m="clr-namespace:Mux.Markup;assembly=Mux.Markup"
xmlns:mu="clr-namespace:Mux.Markup;assembly=Mux.Markup.UI"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:playgroundMarkup="clr-namespace:Mux.Playground.Markup;assembly=Assembly-CSharp">
<!--
Note that you can use "using" scheme instead of "clr-namespace" to omit assembly
specification if:
- the referenced type is in an assembly already loaded. (interpreter)
- the referenced type is in the assembly containing the compiled XAML. (compiler)
-->
<mu:StandaloneInputModule />
<mu:Canvas />
<mu:CanvasScaler UiScale="{mu:ConstantPhysicalSize}" />
<mu:GraphicRaycaster />
<playgroundMarkup:TextTransform TextComponent="{Binding Path=CaptionText, Source={x:Reference Name=dropdown}}">
<mu:ContentSizeFitter VerticalFit="PreferredSize" />
<mu:Dropdown x:Name="dropdown">
<mu:Dropdown.Options>
<mu:DropdownOptionData Text="A" />
<mu:DropdownOptionData Text="B" />
</mu:Dropdown.Options>
</mu:Dropdown>
<m:RectTransform ActiveSelf="False" Body="{Binding Path=Template, Source={x:Reference Name=dropdown}}" X="{m:Stretch}" Y="{m:Sized AnchoredPosition=2, SizeDelta=150, Anchor=0, Pivot=1}">
<m:RectTransform x:Name="viewport" X="{m:Stretch Pivot=0, OffsetMax=-18}" Y="{m:Stretch Pivot=1}">
<m:RectTransform x:Name="content" Y="{m:Sized SizeDelta=28, Anchor=1, Pivot=1}">
<m:RectTransform X="{m:Stretch}" Y="{m:Sized SizeDelta=21}">
<mu:Toggle
Graphic="{Binding Path=Body, Source={x:Reference Name=itemGraphic}}"
TargetGraphic="{Binding Path=Body, Source={x:Reference Name=itemTargetGraphic}}" />
<mu:Image x:Name="itemTargetGraphic" />
<m:RectTransform X="{m:Stretch}" Y="{m:Stretch}">
<mu:Image x:Name="itemGraphic" Color="{m:Color R=0, G=0, B=1, A=0.5}" />
</m:RectTransform>
<playgroundMarkup:TextTransform
TextComponent="{Binding Path=ItemText, Source={x:Reference Name=dropdown}}"
X="{m:Stretch}"
Y="{m:Stretch}" />
</m:RectTransform>
</m:RectTransform>
</m:RectTransform>
<mu:ScrollRect
Viewport="{Binding Path=Body, Source={x:Reference Name=viewport}}"
Content="{Binding Path=Body, Source={x:Reference Name=content}}" />
</m:RectTransform>
</playgroundMarkup:TextTransform>
</m:RectTransform>
Constructors
| Improve this Doc View SourceDropdown()
Declaration
public Dropdown()
Fields
| Improve this Doc View SourceCaptionImageProperty
Backing store for the CaptionImage property.
Declaration
public static readonly BindableProperty CaptionImageProperty
Field Value
Type | Description |
---|---|
BindableProperty |
CaptionTextProperty
Backing store for the CaptionText property.
Declaration
public static readonly BindableProperty CaptionTextProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ItemImageProperty
Backing store for the ItemImage property.
Declaration
public static readonly BindableProperty ItemImageProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ItemTextProperty
Backing store for the ItemText property.
Declaration
public static readonly BindableProperty ItemTextProperty
Field Value
Type | Description |
---|---|
BindableProperty |
OptionsProperty
Backing store for the Options property.
Declaration
public static readonly BindableProperty OptionsProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Remarks
You cannot add the same DropdownOptionData to this property of multiple instances.
This binds the lifetime of DropdownOptionData to the lifetime of the instance.
OptionsSourceProperty
Backing store for the OptionsSource property.
Declaration
public static readonly BindableProperty OptionsSourceProperty
Field Value
Type | Description |
---|---|
BindableProperty |
OptionTemplateProperty
Backing store for the OptionTemplate property.
Declaration
public static readonly BindableProperty OptionTemplateProperty
Field Value
Type | Description |
---|---|
BindableProperty |
TemplateProperty
Backing store for the Template property.
Declaration
public static readonly BindableProperty TemplateProperty
Field Value
Type | Description |
---|---|
BindableProperty |
ValueProperty
Backing store for the Value property.
Declaration
public static readonly BindableProperty ValueProperty
Field Value
Type | Description |
---|---|
BindableProperty |
Properties
| Improve this Doc View SourceCaptionImage
A property that represents UnityEngine.UI.Dropdown.captionImage.
Declaration
public UnityEngine.UI.Image CaptionImage { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.UI.Image |
CaptionText
A property that represents UnityEngine.UI.Dropdown.captionText.
Declaration
public UnityEngine.UI.Text CaptionText { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.UI.Text |
ItemImage
A property that represents UnityEngine.UI.Dropdown.itemImage.
Declaration
public UnityEngine.UI.Image ItemImage { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.UI.Image |
ItemText
A property that represents UnityEngine.UI.Dropdown.itemText.
Declaration
public UnityEngine.UI.Text ItemText { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.UI.Text |
Options
A property that represents UnityEngine.UI.Dropdown.options.
Declaration
public ICollection<DropdownOptionData> Options { get; }
Property Value
Type | Description |
---|---|
ICollection<DropdownOptionData> |
Remarks
This is the content property; you can write as child elements in XAML.
OptionsSource
Gets or sets the source of options to template and display.
Declaration
public IEnumerable OptionsSource { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable |
OptionTemplate
Gets or sets the
Declaration
public DataTemplate OptionTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
Template
A property that represents UnityEngine.UI.Dropdown.template.
Declaration
public UnityEngine.RectTransform Template { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.RectTransform |
Value
A property that represents UnityEngine.UI.Dropdown.value.
Declaration
public int Value { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceAwakeInMainThread()
Declaration
protected override void AwakeInMainThread()
OnBindingContextChanged()
Declaration
protected override void OnBindingContextChanged()