ShapFillProperty.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <UserControl
  2. x:Class="PDF_Office.Views.FillAndSign.PropertyPanel.ShapFillProperty"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  6. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  7. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
  9. xmlns:DashConvert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  10. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  11. xmlns:local="clr-namespace:PDF_Office.Views.FillAndSign.PropertyPanel"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:prism="http://prismlibrary.com/"
  14. d:DesignHeight="450"
  15. d:DesignWidth="260"
  16. prism:ViewModelLocator.AutoWireViewModel="True"
  17. mc:Ignorable="d">
  18. <UserControl.Resources>
  19. <ResourceDictionary>
  20. <ResourceDictionary.MergedDictionaries>
  21. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
  22. <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
  23. </ResourceDictionary.MergedDictionaries>
  24. <Convert:ColorToBrushConverter x:Key="ColorToBrushConvert" />
  25. <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert" />
  26. <DashConvert:DashStyleConverter x:Key="DashStyleConverter" />
  27. <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
  28. </ResourceDictionary>
  29. </UserControl.Resources>
  30. <Grid Background="#F3F3F3">
  31. <StackPanel Margin="16,0,16,0">
  32. <TextBlock
  33. Name="AnnotTypeTitle"
  34. Margin="10,8,0,0"
  35. HorizontalAlignment="Left"
  36. FontFamily="SegoeUI"
  37. FontSize="18"
  38. FontWeight="Bold"
  39. LineHeight="24"
  40. Text="{Binding AnnotTypeTitle}" />
  41. <Border
  42. Width="228"
  43. Height="100"
  44. Margin="0,8,0,0"
  45. Background="White"
  46. BorderBrush="#DDDDDD"
  47. BorderThickness="1"
  48. CornerRadius="2"
  49. Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
  50. >
  51. <Grid>
  52. <Path
  53. Name="SharpPath"
  54. Width="36"
  55. Height="36"
  56. HorizontalAlignment="Center"
  57. VerticalAlignment="Center"
  58. Data="{Binding DataPath}"
  59. Stroke="{Binding SelectColor}"
  60. Opacity="{Binding FillOpacity}"
  61. StrokeDashArray="{Binding Dash, Converter={StaticResource DashStyleConverter}}"
  62. StrokeStartLineCap="Flat"
  63. StrokeThickness="{Binding LineWidth}">
  64. <!--Fill="{Binding FillColor}"-->
  65. <!-- ,Converter={StaticResource ColorToBrushConvert} -->
  66. </Path>
  67. </Grid>
  68. </Border>
  69. <Grid Margin="0,18,0,0">
  70. <Grid.RowDefinitions>
  71. <RowDefinition Height="auto" />
  72. <RowDefinition />
  73. </Grid.RowDefinitions>
  74. <TextBlock Text="Color" VerticalAlignment="Center"/>
  75. <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"
  76. Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
  77. >
  78. <i:Interaction.Triggers>
  79. <i:EventTrigger EventName="SelectedValueChanged">
  80. <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}"/>
  81. </i:EventTrigger>
  82. </i:Interaction.Triggers>
  83. </CompositeControl:SlidContent>
  84. <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" />
  85. </Grid>
  86. <Grid Margin="0,18,0,0">
  87. <Grid.RowDefinitions>
  88. <RowDefinition Height="auto" />
  89. <RowDefinition />
  90. </Grid.RowDefinitions>
  91. <TextBlock Text="Line Style" VerticalAlignment="Center"/>
  92. <Grid Grid.Row="1" Margin="0,10,0,0">
  93. <Grid.ColumnDefinitions>
  94. <ColumnDefinition Width="*" />
  95. <ColumnDefinition Width="80" />
  96. </Grid.ColumnDefinitions>
  97. <Slider
  98. Name="BorderSlider"
  99. Margin="0,0,4,0"
  100. VerticalAlignment="Center"
  101. IsMoveToPointEnabled="True"
  102. IsSelectionRangeEnabled="True"
  103. IsSnapToTickEnabled="True"
  104. Maximum="12"
  105. Minimum="1"
  106. Style="{StaticResource RoundThumbSlider}"
  107. TickFrequency="1"
  108. Value="{Binding LineWidth}">
  109. <Slider.Resources>
  110. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
  111. <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
  112. </Slider.Resources>
  113. </Slider>
  114. <Border
  115. Grid.Column="1"
  116. Width="80"
  117. Height="32"
  118. BorderBrush="#E2E3E6"
  119. BorderThickness="0">
  120. <Grid>
  121. <ComboBox
  122. Name="BorderDropBox"
  123. Padding="10,10,0,0"
  124. Background="Transparent"
  125. BorderBrush="#FFE2E3E6"
  126. BorderThickness="1">
  127. <ComboBox.ItemContainerStyle>
  128. <Style TargetType="{x:Type ComboBoxItem}">
  129. <Setter Property="Padding" Value="10,0,0,0" />
  130. </Style>
  131. </ComboBox.ItemContainerStyle>
  132. <ComboBoxItem
  133. Height="32"
  134. VerticalContentAlignment="Center"
  135. Content="1"
  136. Template="{StaticResource comboxitem}" />
  137. <ComboBoxItem
  138. Height="32"
  139. VerticalContentAlignment="Center"
  140. Content="3"
  141. Template="{StaticResource comboxitem}" />
  142. <ComboBoxItem
  143. Height="32"
  144. VerticalContentAlignment="Center"
  145. Content="6"
  146. Template="{StaticResource comboxitem}" />
  147. <ComboBoxItem
  148. Height="32"
  149. VerticalContentAlignment="Center"
  150. Content="9"
  151. Template="{StaticResource comboxitem}" />
  152. <ComboBoxItem
  153. Height="32"
  154. VerticalContentAlignment="Center"
  155. Content="12"
  156. Template="{StaticResource comboxitem}" />
  157. <i:Interaction.Triggers>
  158. <i:EventTrigger EventName="SelectionChanged">
  159. <i:InvokeCommandAction Command="{Binding ThicknessChangedCommand}" CommandParameter="{Binding ElementName=BorderDropBox, Path=SelectedItem}" />
  160. </i:EventTrigger>
  161. </i:Interaction.Triggers>
  162. </ComboBox>
  163. <TextBox
  164. Height="20"
  165. Margin="10,0,35,0"
  166. VerticalAlignment="Center"
  167. Background="White"
  168. BorderThickness="0"
  169. FontFamily="Segoe UI"
  170. FontSize="14"
  171. IsReadOnly="True"
  172. Text="{Binding ElementName=BorderSlider, Path=Value}"
  173. TextAlignment="Left" />
  174. </Grid>
  175. </Border>
  176. </Grid>
  177. </Grid>
  178. <Border
  179. Width="228"
  180. Height="32"
  181. Margin="0,12,0,0"
  182. BorderBrush="#FFE2E3E6"
  183. BorderThickness="1"
  184. Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
  185. >
  186. <Grid Name="ToolGrid">
  187. <Grid.ColumnDefinitions>
  188. <ColumnDefinition Width="40.5" />
  189. <ColumnDefinition Width="40.5" />
  190. <ColumnDefinition Width="40.5" />
  191. <ColumnDefinition Width="40.5" />
  192. <ColumnDefinition Width="40.5" />
  193. </Grid.ColumnDefinitions>
  194. <ToggleButton
  195. Name="HookShapeBtn"
  196. Width="40.5"
  197. Background="Transparent"
  198. BorderThickness="0"
  199. Click="SharpsBtn_Click"
  200. Command="{Binding SharpsTypeCommand}"
  201. CommandParameter="{Binding ElementName=HookShapeBtn, Path=Tag}"
  202. Tag="HookShape">
  203. <Path
  204. Width="15"
  205. Height="13"
  206. HorizontalAlignment="Center"
  207. VerticalAlignment="Center"
  208. StrokeThickness="1.6"
  209. StrokeLineJoin="Round"
  210. Stroke="#616469">
  211. <Path.Data>M0.599976 7.0286L5.57775 11.8L13.4 1.40002
  212. </Path.Data>
  213. </Path>
  214. </ToggleButton>
  215. <ToggleButton
  216. Name="ForkShapeBtn"
  217. Grid.Column="1"
  218. Width="40.5"
  219. Margin="0,0,0,0"
  220. Background="Transparent"
  221. BorderThickness="0"
  222. Click="SharpsBtn_Click"
  223. Command="{Binding SharpsTypeCommand}"
  224. CommandParameter="{Binding ElementName=ForkShapeBtn, Path=Tag}"
  225. Tag="ForkShape">
  226. <Path
  227. Width="16"
  228. Height="16"
  229. HorizontalAlignment="Center"
  230. VerticalAlignment="Center"
  231. StrokeThickness="1.6"
  232. StrokeLineJoin="Round"
  233. Stroke="#616469">
  234. <Path.Data>
  235. M3.19995 3.20001L12.8 12.8
  236. M12.8 3.20001L3.20005 12.8
  237. </Path.Data>
  238. </Path>
  239. </ToggleButton>
  240. <ToggleButton
  241. Name="RectShapeBtn"
  242. Grid.Column="2"
  243. Width="40.5"
  244. Background="Transparent"
  245. BorderThickness="0"
  246. Click="SharpsBtn_Click"
  247. Command="{Binding SharpsTypeCommand}"
  248. CommandParameter="{Binding ElementName=RectShapeBtn, Path=Tag}"
  249. Tag="RectShape">
  250. <Rectangle
  251. Width="9.6"
  252. Height="9.6"
  253. StrokeThickness="1.6"
  254. RadiusX="1.20002"
  255. RadiusY="1.20002"
  256. HorizontalAlignment="Center"
  257. VerticalAlignment="Center"
  258. Stroke="#616469" />
  259. </ToggleButton>
  260. <ToggleButton
  261. Name="LineShapeBtn"
  262. Grid.Column="3"
  263. Width="40.5"
  264. Background="Transparent"
  265. BorderThickness="0"
  266. Click="SharpsBtn_Click"
  267. Command="{Binding SharpsTypeCommand}"
  268. CommandParameter="{Binding ElementName=LineShapeBtn, Path=Tag}"
  269. Tag="LineShape">
  270. <Path
  271. Width="14"
  272. Height="2"
  273. HorizontalAlignment="Center"
  274. VerticalAlignment="Center"
  275. StrokeThickness="1.6"
  276. StrokeLineJoin="Round"
  277. Stroke="#616469">
  278. <Path.Data>
  279. M13.4 1L0.600024 1
  280. </Path.Data>
  281. </Path>
  282. </ToggleButton>
  283. <ToggleButton
  284. Name="DotShapeBtn"
  285. Width="40.5"
  286. Grid.Column="4"
  287. Background="Transparent"
  288. BorderThickness="0"
  289. Click="SharpsBtn_Click"
  290. Command="{Binding SharpsTypeCommand}"
  291. CommandParameter="{Binding ElementName=DotShapeBtn, Path=Tag}"
  292. Tag="DotShape">
  293. <Ellipse
  294. Width="4.8"
  295. Height="4.8"
  296. HorizontalAlignment="Center"
  297. VerticalAlignment="Center"
  298. Fill="#616469" />
  299. </ToggleButton>
  300. </Grid>
  301. </Border>
  302. </StackPanel>
  303. </Grid>
  304. </UserControl>