ShapFillProperty.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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" InitValue="{Binding FillOpacity, Mode=OneWay}">
  74. <i:Interaction.Triggers>
  75. <i:EventTrigger EventName="SelectedValueChanged">
  76. <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}"/>
  77. </i:EventTrigger>
  78. </i:Interaction.Triggers>
  79. </CompositeControl:SlidContent>
  80. <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" ItemSource="{Binding ShapeColorItems}" UIColor="{Binding ShapeColorColor,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
  81. </Grid>
  82. <Grid Margin="0,18,0,0" Visibility="Collapsed">
  83. <Grid.RowDefinitions>
  84. <RowDefinition Height="auto" />
  85. <RowDefinition />
  86. </Grid.RowDefinitions>
  87. <TextBlock Text="Line Style" VerticalAlignment="Center"/>
  88. <Grid Grid.Row="1" Margin="0,10,0,0">
  89. <Grid.ColumnDefinitions>
  90. <ColumnDefinition Width="*" />
  91. <ColumnDefinition Width="80" />
  92. </Grid.ColumnDefinitions>
  93. <Slider
  94. Name="BorderSlider"
  95. Margin="0,0,4,0"
  96. VerticalAlignment="Center"
  97. IsMoveToPointEnabled="True"
  98. IsSelectionRangeEnabled="True"
  99. IsSnapToTickEnabled="True"
  100. Maximum="12"
  101. Minimum="1"
  102. Style="{StaticResource RoundThumbSlider}"
  103. TickFrequency="1"
  104. Value="{Binding LineWidth}"
  105. >
  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. <i:Interaction.Triggers>
  111. <i:EventTrigger EventName="ValueChanged">
  112. <i:InvokeCommandAction Command="{Binding SelectedLineWidthValueCommand}" CommandParameter="{Binding ElementName=BorderSlider,Path=Value}"/>
  113. </i:EventTrigger>
  114. </i:Interaction.Triggers>
  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. <StackPanel Margin="0,18,0,0" Visibility="Collapsed"><!--Visibility="{Binding IsSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"-->
  181. <TextBlock Text="Fill Type" VerticalAlignment="Center"/>
  182. <Border
  183. Width="228"
  184. Height="32"
  185. Margin="0,10,0,0"
  186. BorderBrush="#FFE2E3E6"
  187. BorderThickness="1"
  188. >
  189. <Grid Name="ToolGrid" >
  190. <Grid.ColumnDefinitions>
  191. <ColumnDefinition Width="40.5" />
  192. <ColumnDefinition Width="40.5" />
  193. <ColumnDefinition Width="40.5" />
  194. <ColumnDefinition Width="40.5" />
  195. <ColumnDefinition Width="40.5" />
  196. </Grid.ColumnDefinitions>
  197. <ToggleButton
  198. Name="HookShapeBtn"
  199. Width="40.5"
  200. Background="Transparent"
  201. BorderThickness="0"
  202. Click="SharpsBtn_Click"
  203. IsChecked="{Binding HookIsChecked}"
  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. IsChecked="{Binding ForkIsChecked}"
  228. Command="{Binding SharpsTypeCommand}"
  229. CommandParameter="{Binding ElementName=ForkShapeBtn, Path=Tag}"
  230. Tag="ForkShape">
  231. <Path
  232. Width="16"
  233. Height="16"
  234. HorizontalAlignment="Center"
  235. VerticalAlignment="Center"
  236. StrokeThickness="1.6"
  237. StrokeLineJoin="Round"
  238. Stroke="#616469">
  239. <Path.Data>
  240. M3.19995 3.20001L12.8 12.8
  241. M12.8 3.20001L3.20005 12.8
  242. </Path.Data>
  243. </Path>
  244. </ToggleButton>
  245. <ToggleButton
  246. Name="RectShapeBtn"
  247. Grid.Column="2"
  248. Width="40.5"
  249. Background="Transparent"
  250. BorderThickness="0"
  251. Click="SharpsBtn_Click"
  252. IsChecked="{Binding RectIsChecked}"
  253. Command="{Binding SharpsTypeCommand}"
  254. CommandParameter="{Binding ElementName=RectShapeBtn, Path=Tag}"
  255. Tag="RectShape">
  256. <Rectangle
  257. Width="9.6"
  258. Height="9.6"
  259. StrokeThickness="1.6"
  260. RadiusX="1.20002"
  261. RadiusY="1.20002"
  262. HorizontalAlignment="Center"
  263. VerticalAlignment="Center"
  264. Stroke="#616469" />
  265. </ToggleButton>
  266. <ToggleButton
  267. Name="LineShapeBtn"
  268. Grid.Column="3"
  269. Width="40.5"
  270. Background="Transparent"
  271. BorderThickness="0"
  272. Click="SharpsBtn_Click"
  273. IsChecked="{Binding LineIsChecked}"
  274. Command="{Binding SharpsTypeCommand}"
  275. CommandParameter="{Binding ElementName=LineShapeBtn, Path=Tag}"
  276. Tag="LineShape">
  277. <Path
  278. Width="14"
  279. Height="2"
  280. HorizontalAlignment="Center"
  281. VerticalAlignment="Center"
  282. StrokeThickness="1.6"
  283. StrokeLineJoin="Round"
  284. Stroke="#616469">
  285. <Path.Data>
  286. M13.4 1L0.600024 1
  287. </Path.Data>
  288. </Path>
  289. </ToggleButton>
  290. <ToggleButton
  291. Name="DotShapeBtn"
  292. Width="40.5"
  293. Grid.Column="4"
  294. Background="Transparent"
  295. BorderThickness="0"
  296. Click="SharpsBtn_Click"
  297. IsChecked="{Binding DotIsChecked}"
  298. Command="{Binding SharpsTypeCommand}"
  299. CommandParameter="{Binding ElementName=DotShapeBtn, Path=Tag}"
  300. Tag="DotShape">
  301. <Ellipse
  302. Width="4.8"
  303. Height="4.8"
  304. HorizontalAlignment="Center"
  305. VerticalAlignment="Center"
  306. Fill="#616469" />
  307. </ToggleButton>
  308. </Grid>
  309. </Border>
  310. </StackPanel>
  311. </StackPanel>
  312. </Grid>
  313. </UserControl>