ComboBox with complex item
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:
Re: ComboBox with complex item
UPDATE: Noesis behaves properly when using templating.
Code: Select all
<ComboBox Width="80" Height="40" ItemsSource="{Binding ComboItems}">
<ComboBox.ItemTemplate>
<DataTemplate>
<Border Background="Yellow">
<Label Content="{Binding}"/>
</Border>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: ComboBox with complex item
Yes, I've just looked at the code and it is not yet implemented. When items are UIElement the ComboBox.SelectionBoxItem property, used to render the selected item, is not correctly updated.
Could you please add this problem to the bugtracker?
Could you please add this problem to the bugtracker?
Who is online
Users browsing this forum: Bing [Bot] and 93 guests