SignatureCreateDialog.xaml 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <UserControl x:Class="PDF_Master.Views.PropertyPanel.AnnotPanel.SignatureCreateDialog"
  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_Master.Views.PropertyPanel.AnnotPanel" xmlns:cus="clr-namespace:PDF_Master.CustomControl" xmlns:annotpanel="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel" xmlns:dataconvert="clr-namespace:PDF_Master.DataConvert" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" d:DataContext="{d:DesignInstance Type=annotpanel:SignatureCreateDialogViewModel}"
  7. xmlns:prism="http://prismlibrary.com/"
  8. prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
  9. Loaded="UserControl_Loaded"
  10. Width="468"
  11. Height="392"
  12. mc:Ignorable="d" >
  13. <UserControl.Resources>
  14. <Style TargetType="{x:Type TabItem}">
  15. <Setter Property="Width" Value="74.67 " />
  16. <Setter Property="Height" Value="28" />
  17. <Setter Property="BorderThickness" Value="0" />
  18. <Setter Property="Template" Value="{DynamicResource Segmented}" />
  19. </Style>
  20. <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert"/>
  21. <dataconvert:IntAndTagToBoolMultiBinding x:Key="IntAndTagToBoolMultiBinding"/>
  22. <dataconvert:ListCountAndBoolToVisible x:Key="ListCountAndBoolToVisible"/>
  23. <dataconvert:IntToColorBrush x:Key="IntToColorBrush"/>
  24. <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
  25. <dataconvert:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
  26. <dataconvert:SignatureButtonConvert x:Key="SignatureButtonConvert"/>
  27. <Style x:Key="TriangleToolTipStyle" TargetType="ToolTip">
  28. <Setter Property="Template">
  29. <Setter.Value>
  30. <ControlTemplate>
  31. <StackPanel>
  32. <Path HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 6 0 L 0 6 L 12 6 Z" Fill="#E6333333" Margin="0,0,10,0"/>
  33. <Border CornerRadius="8" Background="#E6333333" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  34. <TextBlock Text="{TemplateBinding ContentControl.Content}" Foreground="White" LineHeight="20" Margin="6"/>
  35. </Border>
  36. </StackPanel>
  37. </ControlTemplate>
  38. </Setter.Value>
  39. </Setter>
  40. </Style>
  41. </UserControl.Resources>
  42. <cus:DialogContent x:Name="DialogHeader">
  43. <cus:DialogContent.Content>
  44. <TabControl
  45. BorderThickness="0"
  46. Style="{StaticResource FormTabControl }"
  47. SelectedIndex="{Binding TabItemIndex,Mode=TwoWay}">
  48. <TabItem x:Name="InputItem">
  49. <Grid>
  50. <Grid.RowDefinitions>
  51. <RowDefinition Height="*"/>
  52. <RowDefinition Height="32"/>
  53. </Grid.RowDefinitions>
  54. <Grid.ColumnDefinitions>
  55. <ColumnDefinition Width="16"/>
  56. <ColumnDefinition Width="*"/>
  57. <ColumnDefinition Width="16"/>
  58. </Grid.ColumnDefinitions>
  59. <cus:TextBoxEx
  60. x:Name="InPutTextBox"
  61. FontFamily="{Binding ElementName=TextComBox,Path=SelectedValue, TargetNullValue=Segoe UI}"
  62. Background="{StaticResource color.sys.layout.mg}" Grid.Column="1"
  63. TextChanged="TextBoxEx_TextChanged"
  64. PlaceholderText="Input" Height="182" FontSize="20"
  65. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  66. ShowClose="False" Text="{Binding InputText,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
  67. Foreground ="{Binding RadioButtonIndex,Converter={StaticResource IntToColorBrush}}" />
  68. <Button x:Name="BtnTextClear" Margin="0,0,8,24" Visibility="{Binding ShowTextButton}" Style="{StaticResource btn.sec}" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="24" Width="43" Command="{Binding ClearTextCommnad}" />
  69. <ComboBox Grid.Row="1" Grid.Column="1" x:Name="TextComBox"
  70. Width="200"
  71. HorizontalAlignment="Left"
  72. VerticalContentAlignment="Center"
  73. ItemsSource="{Binding FontNameList}"
  74. SelectedIndex="{Binding FontNameIndex,Mode=TwoWay}"/>
  75. <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
  76. <cus:PathRadioButton CornerRadius="4" Tag="1" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
  77. <cus:PathRadioButton.Content>
  78. <Grid Width="32" Height="32">
  79. <Ellipse Width="20" Height="20" Fill="#252629"/>
  80. </Grid>
  81. </cus:PathRadioButton.Content>
  82. <i:Interaction.Triggers>
  83. <i:EventTrigger EventName="Checked">
  84. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  85. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  86. PassEventArgsToCommand="True" />
  87. </i:EventTrigger>
  88. </i:Interaction.Triggers>
  89. <RadioButton.IsChecked>
  90. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  91. <Binding Source="1"/>
  92. <Binding Path="RadioButtonIndex"/>
  93. </MultiBinding>
  94. </RadioButton.IsChecked>
  95. </cus:PathRadioButton>
  96. <cus:PathRadioButton Tag="2" CornerRadius="4" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
  97. <cus:PathRadioButton.Content>
  98. <Grid Width="32" Height="32">
  99. <Ellipse Width="20" Height="20" Fill="#F3465B"/>
  100. </Grid>
  101. </cus:PathRadioButton.Content>
  102. <i:Interaction.Triggers>
  103. <i:EventTrigger EventName="Checked">
  104. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  105. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  106. PassEventArgsToCommand="True" />
  107. </i:EventTrigger>
  108. </i:Interaction.Triggers>
  109. <RadioButton.IsChecked>
  110. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  111. <Binding Source="2"/>
  112. <Binding Path="RadioButtonIndex"/>
  113. </MultiBinding>
  114. </RadioButton.IsChecked>
  115. </cus:PathRadioButton>
  116. <cus:PathRadioButton Tag="3" CornerRadius="4" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
  117. <cus:PathRadioButton.Content>
  118. <Grid Width="32" Height="32">
  119. <Ellipse Width="20" Height="20" Fill="#273C62"/>
  120. </Grid>
  121. </cus:PathRadioButton.Content>
  122. <i:Interaction.Triggers>
  123. <i:EventTrigger EventName="Checked">
  124. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  125. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  126. PassEventArgsToCommand="True" />
  127. </i:EventTrigger>
  128. </i:Interaction.Triggers>
  129. <RadioButton.IsChecked>
  130. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  131. <Binding Source="3"/>
  132. <Binding Path="RadioButtonIndex"/>
  133. </MultiBinding>
  134. </RadioButton.IsChecked>
  135. </cus:PathRadioButton>
  136. <cus:PathRadioButton Tag="4" CornerRadius="4" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
  137. <cus:PathRadioButton.Content>
  138. <Grid Width="32" Height="32">
  139. <Ellipse Width="20" Height="20" Fill="#94989C"/>
  140. </Grid>
  141. </cus:PathRadioButton.Content>
  142. <i:Interaction.Triggers>
  143. <i:EventTrigger EventName="Checked">
  144. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  145. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  146. PassEventArgsToCommand="True" />
  147. </i:EventTrigger>
  148. </i:Interaction.Triggers>
  149. <RadioButton.IsChecked>
  150. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  151. <Binding Source="4"/>
  152. <Binding Path="RadioButtonIndex"/>
  153. </MultiBinding>
  154. </RadioButton.IsChecked>
  155. </cus:PathRadioButton>
  156. </StackPanel>
  157. </Grid>
  158. </TabItem>
  159. <TabItem x:Name="DrawItem">
  160. <Grid>
  161. <Grid.RowDefinitions>
  162. <RowDefinition Height="*"/>
  163. <RowDefinition Height="32"/>
  164. </Grid.RowDefinitions>
  165. <Grid.ColumnDefinitions>
  166. <ColumnDefinition Width="16"/>
  167. <ColumnDefinition Width="*"/>
  168. <ColumnDefinition Width="16"/>
  169. </Grid.ColumnDefinitions>
  170. <Border Grid.Column="1" Height="182" BorderThickness="1" CornerRadius="4" BorderBrush="{StaticResource color.field.border.norm}">
  171. <Grid>
  172. <InkCanvas x:Name="inkCanvas" PreviewMouseLeftButtonDown="inkCanvas_MouseLeftButtonDown" PreviewMouseLeftButtonUp="inkCanvas_MouseLeftButtonUp" DefaultDrawingAttributes="{Binding DrawingAttributeObject}" Strokes="{Binding StrokesObject}"/>
  173. <Grid Opacity="0.7" x:Name="PlanGrid" IsHitTestVisible="False" Background="#F3F3F3">
  174. <Grid.Visibility>
  175. <MultiBinding Converter="{StaticResource ListCountAndBoolToVisible }" Mode="OneWay">
  176. <Binding Path="StrokesObject.Count"/>
  177. <Binding Path="IsMouseDown"/>
  178. </MultiBinding>
  179. </Grid.Visibility>
  180. <TextBlock x:Name="DrawHint" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  181. </Grid>
  182. <Button x:Name="BtnDrawClear" Style="{StaticResource btn.sec}" Margin="0,0,8,8" Width="43" Height="24" HorizontalAlignment="Right" VerticalAlignment="Bottom" Command="{Binding ClearInkCanvasCommnad}" Visibility="{Binding ElementName=PlanGrid,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"/>
  183. </Grid>
  184. </Border>
  185. <ComboBox Grid.Row="1" Grid.Column="1"
  186. Width="80"
  187. HorizontalAlignment="Left"
  188. VerticalContentAlignment="Center"
  189. ItemsSource="{Binding ThicknessList}"
  190. SelectedIndex="{Binding ThicknessListIndex,Mode=TwoWay}"/>
  191. <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal" >
  192. <cus:PathRadioButton Tag="1" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
  193. <cus:PathRadioButton.Content>
  194. <Grid Width="32" Height="32">
  195. <Ellipse Width="20" Height="20" Fill="#252629"/>
  196. </Grid>
  197. </cus:PathRadioButton.Content>
  198. <i:Interaction.Triggers>
  199. <i:EventTrigger EventName="Checked">
  200. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  201. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  202. PassEventArgsToCommand="True" />
  203. </i:EventTrigger>
  204. </i:Interaction.Triggers>
  205. <RadioButton.IsChecked>
  206. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  207. <Binding Source="1"/>
  208. <Binding Path="ImageRadioButtonIndex"/>
  209. </MultiBinding>
  210. </RadioButton.IsChecked>
  211. </cus:PathRadioButton>
  212. <cus:PathRadioButton Tag="2" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
  213. <cus:PathRadioButton.Content>
  214. <Grid Width="32" Height="32">
  215. <Ellipse Width="20" Height="20" Fill="#FC1F1F"/>
  216. </Grid>
  217. </cus:PathRadioButton.Content>
  218. <i:Interaction.Triggers>
  219. <i:EventTrigger EventName="Checked">
  220. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  221. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  222. PassEventArgsToCommand="True" />
  223. </i:EventTrigger>
  224. </i:Interaction.Triggers>
  225. <RadioButton.IsChecked>
  226. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  227. <Binding Source="2"/>
  228. <Binding Path="ImageRadioButtonIndex"/>
  229. </MultiBinding>
  230. </RadioButton.IsChecked>
  231. </cus:PathRadioButton>
  232. <cus:PathRadioButton Tag="3" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
  233. <cus:PathRadioButton.Content>
  234. <Grid Width="32" Height="32">
  235. <Ellipse Width="20" Height="20" Fill="#273C62"/>
  236. </Grid>
  237. </cus:PathRadioButton.Content>
  238. <i:Interaction.Triggers>
  239. <i:EventTrigger EventName="Checked">
  240. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  241. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  242. PassEventArgsToCommand="True" />
  243. </i:EventTrigger>
  244. </i:Interaction.Triggers>
  245. <RadioButton.IsChecked>
  246. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  247. <Binding Source="3"/>
  248. <Binding Path="ImageRadioButtonIndex"/>
  249. </MultiBinding>
  250. </RadioButton.IsChecked>
  251. </cus:PathRadioButton>
  252. <cus:PathRadioButton Tag="4" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
  253. <cus:PathRadioButton.Content>
  254. <Grid Width="32" Height="32">
  255. <Ellipse Width="20" Height="20" Fill="#94989C"/>
  256. </Grid>
  257. </cus:PathRadioButton.Content>
  258. <i:Interaction.Triggers>
  259. <i:EventTrigger EventName="Checked">
  260. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  261. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  262. PassEventArgsToCommand="True" />
  263. </i:EventTrigger>
  264. </i:Interaction.Triggers>
  265. <RadioButton.IsChecked>
  266. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  267. <Binding Source="4"/>
  268. <Binding Path="ImageRadioButtonIndex"/>
  269. </MultiBinding>
  270. </RadioButton.IsChecked>
  271. </cus:PathRadioButton>
  272. </StackPanel>
  273. </Grid>
  274. </TabItem>
  275. <TabItem x:Name="PictureItem">
  276. <Grid>
  277. <Grid.RowDefinitions>
  278. <RowDefinition Height="*"/>
  279. <RowDefinition Height="32"/>
  280. </Grid.RowDefinitions>
  281. <Grid.ColumnDefinitions>
  282. <ColumnDefinition Width="16"/>
  283. <ColumnDefinition Width="*"/>
  284. <ColumnDefinition Width="16"/>
  285. </Grid.ColumnDefinitions>
  286. <Border Grid.Column="1" Height="182" BorderThickness="1" CornerRadius="4" BorderBrush="{StaticResource color.field.border.norm}">
  287. <Grid Background="{StaticResource color.sys.layout.mg}">
  288. <StackPanel x:Name="AddStackPanel" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding ShowImageButton}">
  289. <cus:ImageButton
  290. Height="128" Width="128" IconHeight="128" IconWidth="128"
  291. Icon="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImage.png"
  292. IconPress="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImageSuspend.png"
  293. IconMouseOver="pack://application:,,,/PDF Master;component/Resources/Dialog/AddImageSuspend.png"
  294. Command="{Binding OpenImageCommnad}"/>
  295. <TextBlock x:Name="ImageHint" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource color.sys.text.neutral.lv3}"/>
  296. </StackPanel>
  297. <Grid Visibility="{Binding ElementName=AddStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}">
  298. <Grid.RowDefinitions>
  299. <RowDefinition Height="24"/>
  300. <RowDefinition Height="*"/>
  301. </Grid.RowDefinitions>
  302. <Image Grid.RowSpan="2" Width="200" Height="200" Source="{Binding ImagePreviewSource}" />
  303. <Button x:Name="BtnPictureReselect" Style="{StaticResource btn.sec}" Grid.Row="1" Width="60" Height="24" Margin="0,0,8,8" HorizontalAlignment="Right" VerticalAlignment="Bottom" Command="{Binding OpenImageCommnad}"/>
  304. </Grid>
  305. </Grid>
  306. </Border>
  307. <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
  308. <CheckBox Width="20" Height="20" IsChecked="{Binding IsRemoveBackground}"/>
  309. <TextBlock x:Name="BtnReBkg" FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  310. <cus:ImageButton Margin="8,0,0,0"
  311. Height="16" Width="16" IconHeight="16" IconWidth="16"
  312. Icon="pack://application:,,,/PDF Master;component/Resources/Dialog/help.png"
  313. IconPress="pack://application:,,,/PDF Master;component/Resources/Dialog/help.png"
  314. IconMouseOver="pack://application:,,,/PDF Master;component/Resources/Dialog/helphover.png">
  315. <cus:ImageButton.ToolTip >
  316. <ToolTip Style ="{StaticResource TriangleToolTipStyle}" x:Name="BtnReBkgHint" Placement="Bottom" >
  317. <ToolTip.HorizontalOffset>
  318. <MultiBinding Converter="{StaticResource CenterToolTipConverter}">
  319. <Binding RelativeSource="{RelativeSource Self}" Path="PlacementTarget.ActualWidth"/>
  320. <Binding RelativeSource="{RelativeSource Self}" Path="ActualWidth"/>
  321. </MultiBinding>
  322. </ToolTip.HorizontalOffset>
  323. </ToolTip>
  324. </cus:ImageButton.ToolTip>
  325. </cus:ImageButton>
  326. </StackPanel>
  327. </Grid>
  328. </TabItem>
  329. </TabControl>
  330. </cus:DialogContent.Content>
  331. <cus:DialogContent.BottmBar>
  332. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
  333. <Button
  334. x:Name="BtnOK"
  335. Style="{StaticResource Btn.cta}"
  336. Grid.Column="0"
  337. Width="80"
  338. Height="32"
  339. HorizontalAlignment="Right"
  340. Command="{Binding CreateCommnad}">
  341. <Button.IsEnabled>
  342. <MultiBinding Converter="{StaticResource SignatureButtonConvert }" Mode="OneWay">
  343. <Binding Path="TabItemIndex"/>
  344. <Binding Path="InputText"/>
  345. <Binding Path="StrokesObject.Count"/>
  346. <Binding Path="ImagePreviewSource"/>
  347. </MultiBinding>
  348. </Button.IsEnabled>
  349. </Button>
  350. <Button
  351. x:Name="BtnNo"
  352. Style="{StaticResource btn.sec}"
  353. Grid.Column="2"
  354. Width="80"
  355. Height="32"
  356. Margin="16,0,16,0"
  357. HorizontalAlignment="Left"
  358. Command="{Binding CancelCommand}"/>
  359. </StackPanel>
  360. </cus:DialogContent.BottmBar>
  361. </cus:DialogContent>
  362. </UserControl>