<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SignatureAnnotProperty"
             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.PropertyPanel.AnnotPanel" xmlns:customcontrol="clr-namespace:PDF_Office.CustomControl" xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel" d:DataContext="{d:DesignInstance Type=annotpanel:SignatureAnnotPropertyViewModel}"
             mc:Ignorable="d" >
    <UserControl.Resources>
        <PathGeometry x:Key="Ic_AddButtonPath" Figures="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z"  FillRule="EvenOdd" />
    </UserControl.Resources>
    <Grid  Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid x:Name="Header" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="16"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="16"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="1" x:Name="TxtTitle" HorizontalAlignment="Left"
                    VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Text="Signature" />
            <customcontrol:PathButton Grid.Column="1"
                HorizontalAlignment="Right"
            x:Name="BtnAdd"
            Command="{Binding ShowDialogCommand}"
            Height="16" Width="16"  IconHeight="16"  IconWidth="16" 
            Icon="{StaticResource Ic_AddButtonPath}"  IconFill="#616469"
            IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#C04CF8"
            IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#C04CF8" />
        </Grid>
        <Grid Grid.Row="1">
            <ListBox ItemsSource="{Binding SignatureList}" SelectionMode="Single" Width="256" Height="auto" VerticalAlignment="Top"  BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                <ListBox.ItemTemplate>
                    <DataTemplate >
                        <ListBoxItem >
                            <ListBoxItem.ContextMenu>
                                <ContextMenu>
                                    <MenuItem Header="导出签名">
                                        <MenuItem x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click"/>
                                        <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click"/>
                                    </MenuItem>
                                    <MenuItem x:Name="Delete" Header="删除签名" Click="Delete_Click"/>
                                    <MenuItem x:Name="DeleteAll" Header="删除全部签名" Click="DeleteAll_Click"/>
                                </ContextMenu>
                            </ListBoxItem.ContextMenu>
                            <Image Source="{Binding SourcePath}" Stretch="Uniform" Height="48"/>
                        </ListBoxItem>
                    </DataTemplate>
                </ListBox.ItemTemplate>
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="Height" Value="64"/>
                        <Setter Property="Padding" Value="12 8 12 8"/>
                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
                        <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
                    </Style>
                </ListBox.ItemContainerStyle>
            </ListBox>

        </Grid>
    </Grid>
</UserControl>
