<UserControl x:Class="Showcase.WPF.DragDrop.Views.DataGridSamples"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:dd="urn:gong-wpf-dragdrop"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:viewModels="clr-namespace:Showcase.WPF.DragDrop.ViewModels"
             d:DataContext="{d:DesignInstance viewModels:MainViewModel}"
             d:DesignHeight="300"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <Grid>
        <Grid.Resources>
            <Style BasedOn="{StaticResource DefaultDataGridStyle}" TargetType="{x:Type DataGrid}" />
        </Grid.Resources>

        <DockPanel LastChildFill="True">
            <TextBlock DockPanel.Dock="Top"
                       Style="{StaticResource SampleHeaderTextBlockStyle}"
                       Text="DataGrid" />
            <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                <StackPanel>
                    <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Text="Demonstrates the default behaviour with two DataGrids bound to two collections of the same type. Just try drag and drop some Rows from left DataGrid to right DataGrid." />
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <DataGrid x:Name="LeftBoundDataGrid"
                                  Grid.Column="0"
                                  dd:DragDrop.DropScrollingMode="VerticalOnly"
                                  dd:DragDrop.IsDragSource="True"
                                  dd:DragDrop.IsDropTarget="True"
                                  dd:DragDrop.ShowAlwaysDropTargetAdorner="True"
                                  dd:DragDrop.UseDefaultEffectDataTemplate="True"
                                  CanUserAddRows="False"
                                  CanUserDeleteRows="False"
                                  IsReadOnly="True"
                                  ItemsSource="{Binding Data.DataGridCollection1}" />
                        <DataGrid Grid.Column="1"
                                  dd:DragDrop.IsDragSource="True"
                                  dd:DragDrop.IsDropTarget="True"
                                  CanUserAddRows="True"
                                  CanUserDeleteRows="True"
                                  ItemsSource="{Binding Data.DataGridCollection2}" />
                    </Grid>

                    <TextBlock Style="{StaticResource DefaultTextBlockStyle}" Text="Customization (for left DataGrid)" />
                    <CheckBox Margin="10 5"
                              Content="IsDragSource"
                              IsChecked="{Binding ElementName=LeftBoundDataGrid, Path=(dd:DragDrop.IsDragSource), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    <CheckBox Margin="10 5"
                              Content="IsDropTarget"
                              IsChecked="{Binding ElementName=LeftBoundDataGrid, Path=(dd:DragDrop.IsDropTarget), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    <CheckBox Margin="10 5"
                              Content="UseDefaultDragAdorner"
                              IsChecked="{Binding ElementName=LeftBoundDataGrid, Path=(dd:DragDrop.UseDefaultDragAdorner), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    <CheckBox Margin="10 5"
                              Content="UseDefaultEffectDataTemplate"
                              IsChecked="{Binding ElementName=LeftBoundDataGrid, Path=(dd:DragDrop.UseDefaultEffectDataTemplate), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                </StackPanel>
            </ScrollViewer>
        </DockPanel>
    </Grid>
</UserControl>