<UserControl x:Class="PDF_Office.Views.HomePanel.PDFTools.PDFToolsContent"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:PDF_Office.Views.HomePanel.PDFTools"
      xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
      xmlns:converter="clr-namespace:PDF_Office.DataConvert"
      Background="White"  MinWidth="540" MinHeight="460"
      mc:Ignorable="d" 
      d:DesignHeight="450" d:DesignWidth="800"
     >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../../Styles/CustomListItemStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <converter:BoolToVisible x:Key="BoolToVisibilityConverter" />

            <Style x:Key="LabelSty"
               TargetType="{x:Type Label}">
                <Setter Property="Padding"
                    Value="10,5" />
                <Setter Property="Background"
                    Value="CadetBlue" />
                <Setter Property="Foreground"
                    Value="White" />
            </Style>

            <DataTemplate x:Key="DataTemplate">
                <local:PDFToolItem x:Name="data"/>
            </DataTemplate>

            <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
                <WrapPanel AllowDrop="True"
                       Orientation="Horizontal" />
            </ItemsPanelTemplate>

        </ResourceDictionary>
    </UserControl.Resources>
    <Grid x:Name="Grid" Margin="70,51,0,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" MinHeight="200" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel AllowDrop="True"
                    DragOver="ListBoxShortCuts_DragOver"
                    Drop="ListBoxShortCuts_Drop"
                    PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
                    >
            <Grid>
                <TextBlock Text="PDF 工具" FontSize="16" FontFamily="PingFang SC"/>
                <StackPanel
            x:Name="PnlToolsUIBtns" Grid.ColumnSpan="2"
            Grid.Column="0" 
            Margin="0,0,12,0"
            HorizontalAlignment="Right"
            VerticalAlignment="Top"
            Orientation="Horizontal"
            Visibility="Visible">

                    <Button
                x:Name="BtnTools"
                Width="68"
                Height="28"
                Margin="0,0,0,0"
                Background="#FFFFFF"
                Content="Tools"
                Click="BtnTools_Click"
               >

                    </Button>


                    <Button
                x:Name="BtnMore"
                Width="28"
                Height="28"
                Margin="12,0,0,0"
                 Background="#FFFFFF" BorderThickness="0" Content="..."
                Click="BtnMore_Click"
               >
                    </Button>

                </StackPanel>
            </Grid>
           
            <TextBlock Text="首页快捷工具" Margin="0,16,0,0" FontSize="14" FontFamily="PingFang SC"/> 
        </StackPanel>
        <Label Name="label1" Visibility="Collapsed"
               Grid.Row="0"
               AllowDrop="True"
               Content="快捷工具"
               DragOver="ListBoxShortCuts_DragOver"
               Drop="ListBoxShortCuts_Drop"
               FontSize="20"
               PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
               Style="{StaticResource LabelSty}" />

        <customControl:ListBoxEx x:Name="ListShortCuts" HorizontalAlignment="Stretch" Margin="0,8,0,0"  MinWidth="540" 
                        Grid.Row="1"
                        AllowDrop="True"
                        BorderThickness="0"
                        SizeChanged="ListBoxShortCuts_SizeChanged"
                        DragOver="ListBoxShortCuts_DragOver"
                        Drop="ListBoxShortCuts_Drop"
                        ItemContainerStyle="{StaticResource ListBoxItemStyle}"
                        ItemTemplate="{StaticResource DataTemplate}"
                        ItemsPanel="{StaticResource ListItemsPanelTemplate}"
                        PreviewMouseMove="ListBoxShortCuts_PreviewMouseMove"
                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                        SelectionMode="Extended" />
        <StackPanel Grid.Row="2" Margin="0,16,0,16" AllowDrop="True"
                     DragOver="ListBoxShortCuts_DragOver"
                     Drop="ListBoxShortCuts_Drop"
                     PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"   
                    >
            <TextBlock Text="更多工具" FontSize="14" FontFamily="PingFang SC"/>
        </StackPanel>
        <Label Grid.Row="2" Visibility="Collapsed"
               AllowDrop="True"
               Content="更多工具"
               DragOver="ListBoxShortCuts_DragOver"
               Drop="ListBoxShortCuts_Drop"
               FontSize="20"
               PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
               Style="{StaticResource LabelSty}" />
        <customControl:ListBoxEx x:Name="ListMoreCuts" HorizontalAlignment="Stretch" MinWidth="540"
                        Grid.Row="3"
                        AllowDrop="True"
                        BorderThickness="0"
                        SizeChanged="ListBoxMoreCuts_SizeChanged" 
                        DragOver="ListBoxShortCuts_DragOver"
                        ItemContainerStyle="{StaticResource MoreListBoxItemStyle}"
                        ItemTemplate="{StaticResource DataTemplate}"
                        ItemsPanel="{StaticResource ListItemsPanelTemplate}"
                        PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                        SelectionMode="Extended" />
        <Image x:Name="sourceImage" 
               Grid.RowSpan="4"
               Width="260"
               Height="80"
               HorizontalAlignment="Left"
               VerticalAlignment="Top"
               AllowDrop="True"
               IsHitTestVisible="False" />

        <Grid>
            <Image x:Name="moveImage"
               Grid.RowSpan="4"
               Width="260"
               Height="80"
               HorizontalAlignment="Left"
               VerticalAlignment="Top"
               IsHitTestVisible="False"
               Visibility="Hidden">
                <Image.RenderTransform>
                    <TranslateTransform x:Name="tt"
                                    X="0"
                                    Y="0" />
                </Image.RenderTransform>
            </Image>
        </Grid>

    </Grid>
</UserControl>
