ShapFillProperty.xaml 15 KB

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