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