SignatureAnnotProperty.xaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SignatureAnnotProperty"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. 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" xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert" d:DataContext="{d:DesignInstance Type=annotpanel:SignatureAnnotPropertyViewModel}"
  7. mc:Ignorable="d" >
  8. <UserControl.Resources>
  9. <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" />
  10. <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
  11. <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert"/>
  12. </UserControl.Resources>
  13. <Grid Background="Transparent">
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="50"/>
  16. <RowDefinition Height="*"/>
  17. <RowDefinition/>
  18. </Grid.RowDefinitions>
  19. <Grid x:Name="Header" >
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="16"/>
  22. <ColumnDefinition Width="*"/>
  23. <ColumnDefinition Width="16"/>
  24. </Grid.ColumnDefinitions>
  25. <TextBlock Grid.Column="1" x:Name="TxtTitle" HorizontalAlignment="Left"
  26. VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Text="Signature" />
  27. <customcontrol:PathButton Grid.Column="1"
  28. HorizontalAlignment="Right"
  29. x:Name="BtnAdd"
  30. Command="{Binding ShowDialogCommand}"
  31. Height="16" Width="16" IconHeight="16" IconWidth="16"
  32. Icon="{StaticResource Ic_AddButtonPath}" IconFill="#616469"
  33. IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#C04CF8"
  34. IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#C04CF8" />
  35. </Grid>
  36. <Grid Grid.Row="1">
  37. <StackPanel VerticalAlignment="Center" x:Name="NoSignatureStackPanel" Visibility="{Binding SignatureList.Count, Converter={StaticResource ListCountToVisible}}">
  38. <Image Source="pack://application:,,,/PDF Office;component/Resources/PropertyPanel/nosign.png" />
  39. <TextBlock Text="No signature created" FontSize="14" FontFamily="Segoe UI" Height="22" HorizontalAlignment="Center"/>
  40. <TextBlock Width="168" Text="Click the Add button in the upper right corner to create a new signature." FontSize="12" FontFamily="Segoe UI" TextWrapping="Wrap" Foreground="#94989C" HorizontalAlignment="Center"/>
  41. </StackPanel>
  42. <ListBox ItemsSource="{Binding SignatureList}"
  43. SelectedIndex="{Binding CurrentListboxIndex,Mode=TwoWay}"
  44. Visibility="{Binding ElementName=NoSignatureStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"
  45. SelectionMode="Single" Width="256" Height="auto" VerticalAlignment="Top" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  46. <ListBox.ItemTemplate>
  47. <DataTemplate >
  48. <ListBoxItem >
  49. <ListBoxItem.ContextMenu>
  50. <ContextMenu>
  51. <MenuItem Header="导出签名">
  52. <MenuItem x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click"/>
  53. <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click"/>
  54. </MenuItem>
  55. <MenuItem x:Name="Delete" Header="删除签名" Click="Delete_Click"/>
  56. <MenuItem x:Name="DeleteAll" Header="删除全部签名" Click="DeleteAll_Click"/>
  57. </ContextMenu>
  58. </ListBoxItem.ContextMenu>
  59. <Image Source="{Binding SourcePath}" Stretch="Uniform" Height="48"/>
  60. </ListBoxItem>
  61. </DataTemplate>
  62. </ListBox.ItemTemplate>
  63. <ListBox.ItemContainerStyle>
  64. <Style TargetType="ListBoxItem">
  65. <Setter Property="Height" Value="64"/>
  66. <Setter Property="Padding" Value="12 8 12 8"/>
  67. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  68. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
  69. </Style>
  70. </ListBox.ItemContainerStyle>
  71. </ListBox>
  72. </Grid>
  73. </Grid>
  74. </UserControl>