CustomCreateDialog.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.CustomCreateDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:customcontrol="clr-namespace:PDF_Office.CustomControl"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel" xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert" d:DataContext="{d:DesignInstance Type=annotpanel:CustomCreateDialogViewModel}"
  8. mc:Ignorable="d" >
  9. <UserControl.Resources>
  10. <PathGeometry x:Key="Ic_AddButtonPath" Figures="M8.5,2.5 L8.5,7.5 L13.5,7.5 L13.5,8.5 L8.5,8.5 L8.5,13.5 L7.5,13.5 L7.5,8.5 L2.5,8.5 L2.5,7.5 L7.5,7.5 L7.5,2.5 L8.5,2.5 Z"/>
  11. <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert"/>
  12. <dataconvert:IntAndTagToBoolMultiBinding x:Key="IntAndTagToBoolMultiBinding"/>
  13. </UserControl.Resources>
  14. <cus:DialogContent Header="新建图章">
  15. <cus:DialogContent.Content>
  16. <TabControl Grid.Row="1" Name="StampTabControl" SelectedIndex="2" HorizontalAlignment="Center" HorizontalContentAlignment="Center" Style="{StaticResource TabControlWithUnderLineStyle}">
  17. <TabItem x:Name="文字图章"
  18. Header="文字图章"
  19. FontFamily="Segoe UI" Foreground="#FF666666"
  20. HorizontalContentAlignment="Center"
  21. FontSize="16"
  22. Height="40"
  23. Width="88"
  24. IsSelected="True">
  25. <Grid>
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="*"/>
  28. <RowDefinition Height="*"/>
  29. <RowDefinition Height="*"/>
  30. <RowDefinition Height="*"/>
  31. </Grid.RowDefinitions>
  32. <Image Height="50" Source="{Binding TextImageSource}"/>
  33. <TextBox Grid.Row="1" Text="{Binding StampText,Mode=TwoWay}" TextChanged="TextBox_TextChanged">
  34. <i:Interaction.Triggers>
  35. <i:EventTrigger EventName="LostFocus">
  36. <i:InvokeCommandAction Command="{Binding UpDataDynamicCommnad}" PassEventArgsToCommand="True" />
  37. </i:EventTrigger>
  38. <i:EventTrigger EventName="KeyDown">
  39. <i:InvokeCommandAction Command="{Binding KeyDown}" PassEventArgsToCommand="True" />
  40. </i:EventTrigger>
  41. </i:Interaction.Triggers>
  42. </TextBox>
  43. <Grid Grid.Row="2">
  44. <StackPanel Orientation="Horizontal">
  45. <RadioButton Tag="1" Checked="RadioButton_Checked" >
  46. <RadioButton.IsChecked>
  47. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  48. <Binding Source="1"/>
  49. <Binding Path="RadioButtonIndex"/>
  50. </MultiBinding>
  51. </RadioButton.IsChecked>
  52. </RadioButton>
  53. <RadioButton Tag="2" Checked="RadioButton_Checked">
  54. <RadioButton.IsChecked>
  55. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  56. <Binding Source="2"/>
  57. <Binding Path="RadioButtonIndex"/>
  58. </MultiBinding>
  59. </RadioButton.IsChecked>
  60. </RadioButton>
  61. <RadioButton Tag="3" Checked="RadioButton_Checked">
  62. <RadioButton.IsChecked>
  63. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  64. <Binding Source="3"/>
  65. <Binding Path="RadioButtonIndex"/>
  66. </MultiBinding>
  67. </RadioButton.IsChecked>
  68. </RadioButton>
  69. <RadioButton Tag="4" Checked="RadioButton_Checked">
  70. <RadioButton.IsChecked>
  71. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  72. <Binding Source="4"/>
  73. <Binding Path="RadioButtonIndex"/>
  74. </MultiBinding>
  75. </RadioButton.IsChecked>
  76. </RadioButton>
  77. <RadioButton Tag="5" Checked="RadioButton_Checked">
  78. <RadioButton.IsChecked>
  79. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  80. <Binding Source="5"/>
  81. <Binding Path="RadioButtonIndex"/>
  82. </MultiBinding>
  83. </RadioButton.IsChecked>
  84. </RadioButton>
  85. <RadioButton Tag="6" Checked="RadioButton_Checked">
  86. <RadioButton.IsChecked>
  87. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  88. <Binding Source="6"/>
  89. <Binding Path="RadioButtonIndex"/>
  90. </MultiBinding>
  91. </RadioButton.IsChecked>
  92. </RadioButton>
  93. <RadioButton Tag="7" Checked="RadioButton_Checked">
  94. <RadioButton.IsChecked>
  95. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  96. <Binding Source="7"/>
  97. <Binding Path="RadioButtonIndex"/>
  98. </MultiBinding>
  99. </RadioButton.IsChecked>
  100. </RadioButton>
  101. <RadioButton Tag="8" Checked="RadioButton_Checked">
  102. <RadioButton.IsChecked>
  103. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  104. <Binding Source="8"/>
  105. <Binding Path="RadioButtonIndex"/>
  106. </MultiBinding>
  107. </RadioButton.IsChecked>
  108. </RadioButton>
  109. <RadioButton Tag="9" Checked="RadioButton_Checked">
  110. <RadioButton.IsChecked>
  111. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  112. <Binding Source="9"/>
  113. <Binding Path="RadioButtonIndex"/>
  114. </MultiBinding>
  115. </RadioButton.IsChecked>
  116. </RadioButton>
  117. <RadioButton Tag="10" Checked="RadioButton_Checked">
  118. <RadioButton.IsChecked>
  119. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  120. <Binding Source="10"/>
  121. <Binding Path="RadioButtonIndex"/>
  122. </MultiBinding>
  123. </RadioButton.IsChecked>
  124. </RadioButton>
  125. <RadioButton Tag="11" Checked="RadioButton_Checked">
  126. <RadioButton.IsChecked>
  127. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
  128. <Binding Source="11"/>
  129. <Binding Path="RadioButtonIndex"/>
  130. </MultiBinding>
  131. </RadioButton.IsChecked>
  132. </RadioButton>
  133. </StackPanel>
  134. </Grid>
  135. <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center">
  136. <CheckBox Name="Date" VerticalAlignment="Center" FontFamily="Seoge UI" FontSize="14" Content="Date" Padding="7 0 0 0" IsChecked="{Binding IsCheckedDate,Mode=TwoWay}"/>
  137. <CheckBox Name="Time" VerticalAlignment="Center" FontFamily="Seoge UI" FontSize="14" Content="Time" Padding="7 0 0 0" IsChecked="{Binding IsCheckedTime,Mode=TwoWay}"/>
  138. </StackPanel>
  139. </Grid>
  140. </TabItem>
  141. <TabItem x:Name="图片图章"
  142. Header="图片图章"
  143. FontFamily="Segoe UI" Foreground="#FF666666"
  144. HorizontalContentAlignment="Center"
  145. FontSize="16"
  146. Width="86">
  147. <Grid >
  148. <Grid.RowDefinitions>
  149. <RowDefinition Height="*"/>
  150. <RowDefinition Height="20"/>
  151. </Grid.RowDefinitions>
  152. <customcontrol:PathButton
  153. x:Name="BtnAdd"
  154. Height="24" Width="24" IconHeight="20" IconWidth="20"
  155. Icon="{StaticResource Ic_AddButtonPath}" IconFill="Red"
  156. IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#C04CF8"
  157. IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#C04CF8" Visibility="{Binding ShowImageButton}" Command="{Binding OpenImageCommnad}"/>
  158. <Grid Background="Red" Visibility="{Binding ElementName=BtnAdd,Path=Visibility,Converter={StaticResource UnVisivleConvert}}">
  159. <Grid.RowDefinitions>
  160. <RowDefinition Height="24"/>
  161. <RowDefinition Height="*"/>
  162. </Grid.RowDefinitions>
  163. <Image Grid.RowSpan="2" Width="200" Height="200" Source="{Binding ImagePreviewSource}" />
  164. <customcontrol:PathButton
  165. x:Name="BtnReAdd"
  166. HorizontalAlignment="Right" VerticalAlignment="Top"
  167. Height="24" Width="24" IconHeight="20" IconWidth="20"
  168. Icon="{StaticResource Ic_AddButtonPath}" IconFill="Red"
  169. IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#C04CF8"
  170. IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#C04CF8" Command="{Binding OpenImageCommnad}"/>
  171. </Grid>
  172. <CheckBox Grid.Row="1" Width="20" Height="20" IsChecked="{Binding IsRemoveBackground}"/>
  173. </Grid>
  174. </TabItem>
  175. </TabControl>
  176. </cus:DialogContent.Content>
  177. <cus:DialogContent.BottmBar>
  178. <Grid>
  179. <Grid.ColumnDefinitions>
  180. <ColumnDefinition Width="50*" />
  181. <ColumnDefinition Width="50*" />
  182. </Grid.ColumnDefinitions>
  183. <Button
  184. Grid.Column="0"
  185. Width="150"
  186. Height="32"
  187. Margin="25,0,0,0"
  188. HorizontalAlignment="Left"
  189. Command="{Binding CreateCommnad}"
  190. Content="确定" />
  191. <Button
  192. Grid.Column="1"
  193. Width="150"
  194. Height="32"
  195. Margin="0,0,25,0"
  196. HorizontalAlignment="Right"
  197. Command="{Binding CancelCommand}"
  198. Content="取消" />
  199. </Grid>
  200. </cus:DialogContent.BottmBar>
  201. </cus:DialogContent>
  202. </UserControl>