Reputation: 1694
I know how to move items from one listbox to another, but not when they are nested like this:
Can anyone tell me how can I nest them in a list box and move them from one listbox to another just like in the image above?
Thank you.
Upvotes: 1
Views: 345
Reputation: 19294
Items that are shown in a nested way are just like regular items, only the DataTemplate changes.
Say your item class contains 'title' (string) and 'members' (List(of String)), then your
dataTemplate will look like :
<DataTemplate TargetType={x:Type l:MyClass}>
<StackPanel>
<TextBox Text:{Binding title} />
<ItemsControl ItemsSource={Binding members} />
</StackPanel>
</DataTemplate>
So to switch a nested item between two Listbox, just... switch the item !
Upvotes: 1