punker76 / gong-wpf-dragdrop

The GongSolutions.WPF.DragDrop library is a drag'n'drop framework for WPF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

complex itemspanel issue

KimDaeWook opened this issue · comments

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>