ShapFillProperty.xaml 15 KB

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