Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <TreeView ItemsSource="{Binding Groups}" Name="tvGroups" AllowDrop="True"
- Drop="tvDrop" DragOver="tvDragOver">
- <TreeView.ItemTemplate>
- <HierarchicalDataTemplate ItemsSource="{Binding Participants}">
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{Binding Name}" />
- <Button Tag="{Binding .}" Click="Button_Click_2">
- <Image Source="Resources/cross.png" />
- </Button>
- </StackPanel>
- <HierarchicalDataTemplate.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal" >
- <TextBlock Text="{Binding Alias}" />
- <Button Tag="{Binding .}" Name="btnDeleteParticipants" Click="btnParticipants_Click" >
- <Image Source="Resources/cross.png" />
- </Button>
- </StackPanel>
- </DataTemplate>
- </HierarchicalDataTemplate.ItemTemplate>
- </HierarchicalDataTemplate>
- </TreeView.ItemTemplate>
- </TreeView>
- private void tvDrop(object sender, DragEventArgs e)
- {
- if (e.Effects == DragDropEffects.Copy &&
- e.Data.GetDataPresent(typeof(Participant)))
- {
- Participant data = e.Data.GetData(typeof(Participant)) as Participant;
- }
- }
Add Comment
Please, Sign In to add comment