我知道如何将项目从一个列表框移动到另一个,但当它们像这样嵌套时却不知道:
谁能告诉我如何将它们嵌套在列表框中并将它们从一个列表框移动到另一个列表框,就像上图一样?
谢谢你。
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 !