开发者

To get the parent node of a treeview in the TreeViewDragDropTarget in Silverlight

开发者 https://www.devze.com 2023-01-04 00:30 出处:网络
I have created a TreeViewDragDropTarget like this, <controlsToolKit:TreeViewDragDropTarget msWindows:DragDrop.AllowDrop="False" ItemDroppedOnTarget="TreeViewDragDropTarget_ItemDroppe

I have created a TreeViewDragDropTarget like this,

<controlsToolKit:TreeViewDragDropTarget msWindows:DragDrop.AllowDrop="False" ItemDroppedOnTarget="TreeViewDragDropTarget_ItemDroppedOnTarget" ItemDragCompleted="TreeViewDragDropTarget_ItemDragCompleted" AllowedSourceEffects="Copy">
    <controlsToolKit:TreeViewDragDropTarg开发者_StackOverflowet.Resources>
     <common:HierarchicalDataTemplate x:Key="hierarchicalTemplate" ItemsSource="{Binding ChildNode}">
      <TextBlock Text="{Binding MainText, Mode=TwoWay}" TextWrapping="Wrap"/>
     </common:HierarchicalDataTemplate>
    </controlsToolKit:TreeViewDragDropTarget.Resources>
    <controls:TreeView x:Name="MainTreeView" BorderThickness="1" ItemTemplate="{StaticResource hierarchicalTemplate}" Background="Transparent" Cursor="Hand" BorderBrush="{x:Null}" VerticalAlignment="Top"/>
   </controlsToolKit:TreeViewDragDropTarget>

All I am doing is dropping some text into the nodes of the treeview. I want to find the parent node of the drop target. How do I do it?


You need to use the Drop event of the treeview control.

0

精彩评论

暂无评论...
验证码 换一张
取 消