ShapFillProperty.xaml 15 KB

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