ComboBox with complex item
Posted: 14 Jul 2017, 00:30
Hi,
I am having trouble using the combobox in Unity3D, with more complex items (more than just a label or plain text). The selected object doesn't render in the main control, only in the expanding list.
Here is a little piece of sample code and the result:
Any Idea what I might be doing wrong?
Thanks a lot,
Result:
I am having trouble using the combobox in Unity3D, with more complex items (more than just a label or plain text). The selected object doesn't render in the main control, only in the expanding list.
Here is a little piece of sample code and the result:
Code: Select all
<ComboBox Width="80" Height="40">
<ComboBoxItem IsSelected="True">
<StackPanel Orientation="Horizontal" Background="Yellow">
<Label Content="123" Padding="6,4"/>
<Label Content="123" Padding="6,4"/>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem>
<StackPanel Orientation="Horizontal" Background="MediumPurple">
<Label Content="456" Padding="6,4"/>
<Label Content="456" Padding="6,4"/>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem>
<StackPanel Orientation="Horizontal" Background="ForestGreen">
<Label Content="789" Padding="6,4"/>
<Label Content="789" Padding="6,4"/>
</StackPanel>
</ComboBoxItem>
</ComboBox>
Thanks a lot,
Result: