complex itemspanel issue
KimDaeWook opened this issue · 0 comments
KimDaeWook commented
when i created complex itemspanel on treeview control,
DropInfo.VisualTargetOrientation has something wrong.
Root TreeViewItem ItemsPanel : stackpanel vertical
Child TreeViewItem ItemsPanel : wrappanel horizontal
when i drag child Item, drop adorner appears on top.
Below is a sample code.
<TreeView Grid.Column="0" Grid.Row="1" ItemsSource="{Binding TreeCollection}" dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True">
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
</TreeView.ItemContainerStyle>
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<TextBlock Text="{Binding Caption}" />
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>