SignatureAnnotProperty.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <UserControl
  2. x:Class="PDF_Master.Views.PropertyPanel.AnnotPanel.SignatureAnnotProperty"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:annotpanel="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel"
  6. xmlns:customcontrol="clr-namespace:PDF_Master.CustomControl"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:dataconvert="clr-namespace:PDF_Master.DataConvert"
  9. xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.AnnotPanel"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. d:DataContext="{d:DesignInstance Type=annotpanel:SignatureAnnotPropertyViewModel}"
  12. Background="{StaticResource color.sys.layout.mg}"
  13. Loaded="UserControl_Loaded"
  14. mc:Ignorable="d">
  15. <UserControl.Resources>
  16. <PathGeometry
  17. x:Key="Ic_AddButtonPath"
  18. 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"
  19. FillRule="EvenOdd" />
  20. <dataconvert:ListCountToVisible x:Key="ListCountToVisible" />
  21. <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
  22. <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA" />
  23. <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA" />
  24. </UserControl.Resources>
  25. <Grid Background="{StaticResource color.sys.layout.mg}">
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="50" />
  28. <RowDefinition Height="*" />
  29. </Grid.RowDefinitions>
  30. <Grid.ColumnDefinitions>
  31. <ColumnDefinition Width="16" />
  32. <ColumnDefinition Width="*" />
  33. <ColumnDefinition Width="16" />
  34. </Grid.ColumnDefinitions>
  35. <Grid x:Name="Header" Grid.Column="1">
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="16" />
  38. <ColumnDefinition Width="*" />
  39. <ColumnDefinition Width="16" />
  40. </Grid.ColumnDefinitions>
  41. <TextBlock
  42. x:Name="TxtTitle"
  43. Grid.ColumnSpan="2"
  44. HorizontalAlignment="Left"
  45. VerticalAlignment="Center"
  46. FontFamily="Seoge UI"
  47. FontSize="14"
  48. FontWeight="SemiBold" />
  49. <customcontrol:PathButton
  50. x:Name="BtnAdd"
  51. Grid.Column="1"
  52. Width="32"
  53. Height="32"
  54. HorizontalAlignment="Right"
  55. HorizontalContentAlignment="Center"
  56. BorderThickness="1"
  57. Command="{Binding ShowDialogCommand}"
  58. CornerRadius="4"
  59. Icon="{StaticResource Ic_AddButtonPath}"
  60. IconFill="#585A63"
  61. IconHeight="16"
  62. IconMouseOver="{StaticResource Ic_AddButtonPath}"
  63. IconMouseOverFill="#585A63"
  64. IconPress="{StaticResource Ic_AddButtonPath}"
  65. IconPressFill="#585A63"
  66. IconWidth="16"
  67. MouseDownBackground="{StaticResource color.item-state.sel.bg.lv3}"
  68. MouseDownBorderBrush="{StaticResource color.item-state.sel.border.lv3}"
  69. MouseOverBackground="{StaticResource color.item-state.hov.bg}" />
  70. </Grid>
  71. <Grid Grid.Row="1" Grid.Column="1">
  72. <StackPanel
  73. x:Name="NoSignatureStackPanel"
  74. VerticalAlignment="Center"
  75. Visibility="{Binding SignatureList.Count, Converter={StaticResource ListCountToVisible}}">
  76. <Image
  77. Width="128"
  78. Height="128"
  79. Source="pack://application:,,,/PDF Master;component/Resources/PropertyPanel/nosign.png" />
  80. <TextBlock
  81. Height="22"
  82. HorizontalAlignment="Center"
  83. FontFamily="Segoe UI"
  84. FontSize="14"
  85. Text="No signature created" />
  86. <TextBlock
  87. Width="168"
  88. HorizontalAlignment="Center"
  89. FontFamily="Segoe UI"
  90. FontSize="12"
  91. Foreground="#94989C"
  92. Text="Click the Add button in the upper right corner to create a new signature."
  93. TextWrapping="Wrap" />
  94. </StackPanel>
  95. <ListBox
  96. Height="auto"
  97. VerticalAlignment="Stretch"
  98. Background="Transparent"
  99. BorderThickness="0"
  100. ItemsSource="{Binding SignatureList}"
  101. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  102. SelectedIndex="{Binding CurrentListboxIndex, Mode=TwoWay}"
  103. SelectionMode="Single"
  104. Visibility="{Binding ElementName=NoSignatureStackPanel, Path=Visibility, Converter={StaticResource UnVisivleConvert}}">
  105. <ListBox.ItemTemplate>
  106. <DataTemplate>
  107. <Grid>
  108. <Grid.ContextMenu>
  109. <ContextMenu>
  110. <MenuItem Header="{Binding T_MenuRightMenuSignatureAnnot_Export}">
  111. <MenuItem
  112. x:Name="SavePNG"
  113. Click="Save_Click"
  114. Header="{Binding T_MenuRightMenuSignatureAnnotExport_PNG}"
  115. Tag="PNG" />
  116. <MenuItem
  117. x:Name="SavePDF"
  118. Click="Save_Click"
  119. Header="{Binding T_MenuRightMenuSignatureAnnotExport_PDF}"
  120. Tag="PDF" />
  121. </MenuItem>
  122. <MenuItem
  123. x:Name="Delete"
  124. Click="Delete_Click"
  125. Header="{Binding T_MenuRightMenuSignatureAnnot_Delete}" />
  126. <MenuItem
  127. x:Name="DeleteAll"
  128. Click="DeleteAll_Click"
  129. Header="{Binding T_MenuRightMenuSignatureAnnot_DeleteAll}" />
  130. </ContextMenu>
  131. </Grid.ContextMenu>
  132. <Image
  133. Height="48"
  134. Source="{Binding SourcePath}"
  135. Stretch="Uniform" />
  136. </Grid>
  137. </DataTemplate>
  138. </ListBox.ItemTemplate>
  139. <ListBox.ItemContainerStyle>
  140. <Style TargetType="ListBoxItem">
  141. <Setter Property="Height" Value="65" />
  142. <Setter Property="Padding" Value="8" />
  143. <Setter Property="HorizontalContentAlignment" Value="Center" />
  144. <Setter Property="Template">
  145. <Setter.Value>
  146. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  147. <Border
  148. x:Name="Bd"
  149. Padding="{TemplateBinding Padding}"
  150. Background="{TemplateBinding Background}"
  151. BorderBrush="{TemplateBinding BorderBrush}"
  152. BorderThickness="{TemplateBinding BorderThickness}"
  153. CornerRadius="8"
  154. SnapsToDevicePixels="true">
  155. <ContentPresenter
  156. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  157. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  158. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  159. </Border>
  160. <ControlTemplate.Triggers>
  161. <MultiTrigger>
  162. <MultiTrigger.Conditions>
  163. <Condition Property="IsMouseOver" Value="True" />
  164. </MultiTrigger.Conditions>
  165. <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  166. <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource color.item-state.hov.bg}" />
  167. </MultiTrigger>
  168. <MultiTrigger>
  169. <MultiTrigger.Conditions>
  170. <Condition Property="Selector.IsSelectionActive" Value="False" />
  171. <Condition Property="IsSelected" Value="True" />
  172. </MultiTrigger.Conditions>
  173. <Setter TargetName="Bd" Property="Background" Value="{StaticResource Item.SelectedInactive.Background}" />
  174. <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource Item.SelectedInactive.Border}" />
  175. </MultiTrigger>
  176. <MultiTrigger>
  177. <MultiTrigger.Conditions>
  178. <Condition Property="Selector.IsSelectionActive" Value="True" />
  179. <Condition Property="IsSelected" Value="True" />
  180. </MultiTrigger.Conditions>
  181. <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  182. <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  183. </MultiTrigger>
  184. <Trigger Property="IsEnabled" Value="False">
  185. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  186. </Trigger>
  187. </ControlTemplate.Triggers>
  188. </ControlTemplate>
  189. </Setter.Value>
  190. </Setter>
  191. <EventSetter Event="PreviewMouseDown" Handler="ListBoxItem_PreviewMouseDown" />
  192. </Style>
  193. </ListBox.ItemContainerStyle>
  194. </ListBox>
  195. </Grid>
  196. </Grid>
  197. </UserControl>