<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="C1TreeViewDragDropSample.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:C1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:src="clr-namespace:C1TreeViewDragDropSample">
    <UserControl.Resources>
        <src:CustomTemplateSelector x:Key="CustomTemplateSelector">
            <src:CustomTemplateSelector.Resources>
                <ResourceDictionary>
                    <C1:C1HierarchicalDataTemplate x:Key="DepartmentTemplate" ItemsSource="{Binding Employees}">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="icons/group.png" Height="14" Width="14" />
                            <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Padding="4 0 4 0" />
                        </StackPanel>
                    </C1:C1HierarchicalDataTemplate>
                    <DataTemplate x:Key="MaleEmployeeTemplate">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="icons/manager.png" Height="14" Width="14" />
                            <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Padding="4 0 4 0" />
                        </StackPanel>
                    </DataTemplate>
                    <DataTemplate x:Key="FemaleEmployeeTemplate">
                        <StackPanel Orientation="Horizontal">
                            <Image Source="icons/assistant.png" Height="14" Width="14" />
                            <TextBlock Text="{Binding Name}" VerticalAlignment="Center" Padding="4 0 4 0" />
                        </StackPanel>
                    </DataTemplate>
                </ResourceDictionary>
            </src:CustomTemplateSelector.Resources>
        </src:CustomTemplateSelector>
       
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border Margin="0 0 0 10">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="DragDrop Action:" Margin="0 0 5 0" />
                <RadioButton x:Name="Move" Content="Move" IsChecked="True" GroupName="DragDropEffect" Checked="OnButtonChecked" Grid.Column="1" Margin="0,0,5,0" />
                <RadioButton x:Name="Copy" Content="Copy" GroupName="DragDropEffect" Checked="OnButtonChecked" Grid.Row="1" Grid.Column="2" Margin="0" />
            </StackPanel>
        </Border>
        <C1:C1TreeView x:Name="SampleTreeView" Grid.Row="1" Grid.ColumnSpan="2" BorderBrush="#FF8FB4CC" ItemTemplateSelector="{StaticResource CustomTemplateSelector}" Padding="10" />
    </Grid>
</UserControl>