CPDFSignatureUI.xaml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <UserControl x:Class="ComPDFKit.Controls.Annotation.PDFAnnotationPanel.PDFAnnotationUI.CPDFSignatureUI"
  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:ComPDFKit.Controls.Annotation.PDFAnnotationPanel.PDFAnnotationUI"
  7. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  8. mc:Ignorable="d"
  9. Loaded="UserControl_Loaded"
  10. Unloaded="UserControl_Unloaded"
  11. d:DesignHeight="800" d:DesignWidth="300">
  12. <UserControl.Resources>
  13. <ResourceDictionary>
  14. <ResourceDictionary.MergedDictionaries>
  15. <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  16. </ResourceDictionary.MergedDictionaries>
  17. <common:PropertyPanelResourceConverter x:Key="PropertyPanelResourceConverter"></common:PropertyPanelResourceConverter>
  18. </ResourceDictionary>
  19. </UserControl.Resources>
  20. <Grid Background="#FAFCFF">
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="36" />
  23. <RowDefinition Height="2" />
  24. <RowDefinition Height="72" />
  25. <RowDefinition Height="*" />
  26. </Grid.RowDefinitions>
  27. <Border BorderThickness="1" BorderBrush="#1A000000">
  28. <Grid Height="40" Background="White" >
  29. <TextBlock Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Title_Sig}" FontFamily="Microsoft YaHei" FontSize="16" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  30. </Grid>
  31. </Border>
  32. <Button Grid.Row="2" Height="32" Width="236" Click="CreateSignature_Click" Style="{StaticResource ButtonStyle}">
  33. <Button.Content>
  34. <StackPanel Orientation="Horizontal">
  35. <Grid Width="17" Height="16">
  36. <Path Data="M9 7.5V3H8V7.5H3.5V8.5H8V13H9V8.5H13.5V7.5H9Z" Fill="White"/>
  37. </Grid>
  38. <TextBlock Margin="4,0,0,0" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Button_NewSig}" FontFamily="Microsoft YaHei" FontSize="14" FontWeight="Regular" Foreground="White"/>
  39. </StackPanel>
  40. </Button.Content>
  41. </Button>
  42. <ListBox Grid.Row="3"
  43. x:Name="SignatureListBox"
  44. VerticalAlignment="Top"
  45. BorderThickness="0"
  46. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  47. >
  48. <ListBox.ItemTemplate>
  49. <DataTemplate>
  50. <StackPanel Orientation="Horizontal">
  51. <Image Height="48"
  52. Source="{Binding SourcePath}"
  53. Stretch="Uniform" />
  54. </StackPanel>
  55. </DataTemplate>
  56. </ListBox.ItemTemplate>
  57. <ListBox.ItemContainerStyle>
  58. <Style TargetType="ListBoxItem">
  59. <Setter Property="Height" Value="65" />
  60. <Setter Property="Padding" Value="8" />
  61. <Setter Property="HorizontalContentAlignment" Value="Center" />
  62. <Setter Property="Template">
  63. <Setter.Value>
  64. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  65. <Border
  66. x:Name="Bd"
  67. Padding="{TemplateBinding Padding}"
  68. Background="{TemplateBinding Background}"
  69. BorderBrush="{TemplateBinding BorderBrush}"
  70. BorderThickness="{TemplateBinding BorderThickness}"
  71. SnapsToDevicePixels="true">
  72. <Grid>
  73. <ContentPresenter
  74. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  75. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  76. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  77. <Button HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="DeleteIcon" Width="20" Height="20" Background="Transparent" BorderThickness="0" Click="Delete_Click" Visibility="Hidden" >
  78. <Path Width="16" Height="16" Fill="#43474D" Data="M11.8572 12.5643C12.0525 12.7596 12.3691 12.7596 12.5643 12.5643C12.7596 12.3691 12.7596 12.0525 12.5643 11.8572L8.95809 8.25099L12.5643 4.64475C12.7596 4.44949 12.7596 4.1329 12.5643 3.93764C12.3691 3.74238 12.0525 3.74238 11.8572 3.93764L8.25099 7.54389L4.64473 3.93763C4.44946 3.74236 4.13288 3.74236 3.93762 3.93763C3.74236 4.13289 3.74236 4.44947 3.93762 4.64473L7.54388 8.25099L3.93763 11.8572C3.74237 12.0525 3.74237 12.3691 3.93763 12.5643C4.1329 12.7596 4.44948 12.7596 4.64474 12.5643L8.25099 8.9581L11.8572 12.5643Z"/>
  79. </Button>
  80. </Grid>
  81. </Border>
  82. <ControlTemplate.Triggers>
  83. <MultiTrigger>
  84. <MultiTrigger.Conditions>
  85. <Condition Property="IsMouseOver" Value="True" />
  86. </MultiTrigger.Conditions>
  87. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  88. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  89. <Setter TargetName="DeleteIcon" Property="Visibility" Value="Visible" />
  90. </MultiTrigger>
  91. <MultiTrigger>
  92. <MultiTrigger.Conditions>
  93. <Condition Property="Selector.IsSelectionActive" Value="False" />
  94. <Condition Property="IsSelected" Value="True" />
  95. </MultiTrigger.Conditions>
  96. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  97. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  98. </MultiTrigger>
  99. <MultiTrigger>
  100. <MultiTrigger.Conditions>
  101. <Condition Property="Selector.IsSelectionActive" Value="True" />
  102. <Condition Property="IsSelected" Value="True" />
  103. </MultiTrigger.Conditions>
  104. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  105. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  106. </MultiTrigger>
  107. <Trigger Property="IsEnabled" Value="False">
  108. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  109. </Trigger>
  110. </ControlTemplate.Triggers>
  111. </ControlTemplate>
  112. </Setter.Value>
  113. </Setter>
  114. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="Signature_PreviewMouseLeftButtonDown" />
  115. </Style>
  116. </ListBox.ItemContainerStyle>
  117. </ListBox>
  118. </Grid>
  119. </UserControl>