Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. <TreeView ItemsSource="{Binding Groups}" Name="tvGroups" AllowDrop="True"
  2. Drop="tvDrop" DragOver="tvDragOver">
  3. <TreeView.ItemTemplate>
  4. <HierarchicalDataTemplate ItemsSource="{Binding Participants}">
  5. <StackPanel Orientation="Horizontal">
  6. <TextBlock Text="{Binding Name}" />
  7. <Button Tag="{Binding .}" Click="Button_Click_2">
  8. <Image Source="Resources/cross.png" />
  9. </Button>
  10. </StackPanel>
  11. <HierarchicalDataTemplate.ItemTemplate>
  12. <DataTemplate>
  13. <StackPanel Orientation="Horizontal" >
  14. <TextBlock Text="{Binding Alias}" />
  15. <Button Tag="{Binding .}" Name="btnDeleteParticipants" Click="btnParticipants_Click" >
  16. <Image Source="Resources/cross.png" />
  17. </Button>
  18. </StackPanel>
  19. </DataTemplate>
  20. </HierarchicalDataTemplate.ItemTemplate>
  21. </HierarchicalDataTemplate>
  22. </TreeView.ItemTemplate>
  23. </TreeView>
  24.  
  25. private void tvDrop(object sender, DragEventArgs e)
  26. {
  27. if (e.Effects == DragDropEffects.Copy &&
  28. e.Data.GetDataPresent(typeof(Participant)))
  29. {
  30. Participant data = e.Data.GetData(typeof(Participant)) as Participant;
  31.  
  32. }
  33. }
Add Comment
Please, Sign In to add comment