SharpsAnnotProperty.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. <UserControl
  2. x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SharpsAnnotProperty"
  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:Convert="clr-namespace:PDF_Office.DataConvert"
  7. xmlns:DashConvert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  8. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  9. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  10. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  11. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:prism="http://prismlibrary.com/"
  14. d:DesignHeight="450"
  15. d:DesignWidth="800"
  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. <Style x:Key="line1Style" TargetType="{x:Type Line}">
  28. <Setter Property="Visibility">
  29. <Setter.Value>
  30. <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
  31. <Binding ElementName="SharpRectBtn" Path="IsChecked" />
  32. <Binding ElementName="SharpCircleBtn" Path="IsChecked" />
  33. </MultiBinding>
  34. </Setter.Value>
  35. </Setter>
  36. </Style>
  37. <Style x:Key="line2Style" TargetType="{x:Type Line}">
  38. <Setter Property="Visibility">
  39. <Setter.Value>
  40. <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
  41. <Binding ElementName="SharpCircleBtn" Path="IsChecked" />
  42. <Binding ElementName="SharpArrowBtn" Path="IsChecked" />
  43. </MultiBinding>
  44. </Setter.Value>
  45. </Setter>
  46. </Style>
  47. <Style x:Key="line3Style" TargetType="{x:Type Line}">
  48. <Setter Property="Visibility">
  49. <Setter.Value>
  50. <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
  51. <Binding ElementName="SharpArrowBtn" Path="IsChecked" />
  52. <Binding ElementName="SharpLineBtn" Path="IsChecked" />
  53. </MultiBinding>
  54. </Setter.Value>
  55. </Setter>
  56. </Style>
  57. </ResourceDictionary>
  58. </UserControl.Resources>
  59. <Grid Background="#F3F3F3">
  60. <StackPanel>
  61. <TextBlock
  62. Name="AnnotTypeTitle"
  63. Margin="10,8,0,0"
  64. HorizontalAlignment="Left"
  65. FontFamily="SegoeUI"
  66. FontSize="18"
  67. FontWeight="Bold"
  68. LineHeight="24"
  69. Text="{Binding AnnotTypeTitle}" />
  70. <Border
  71. Width="228"
  72. Height="100"
  73. Margin="0,8,0,0"
  74. Background="White"
  75. BorderBrush="#DDDDDD"
  76. BorderThickness="1"
  77. CornerRadius="2">
  78. <Grid>
  79. <Path
  80. Name="SharpPath"
  81. Width="36"
  82. Height="36"
  83. HorizontalAlignment="Center"
  84. VerticalAlignment="Center"
  85. Data="{Binding DataPath}"
  86. Fill="{Binding FillColor}"
  87. Opacity="{Binding FillOpacity}"
  88. Stroke="{Binding SelectColor}"
  89. StrokeDashArray="{Binding Dash, Converter={StaticResource DashStyleConverter}}"
  90. StrokeStartLineCap="Flat"
  91. StrokeThickness="{Binding LineWidth}">
  92. <!-- ,Converter={StaticResource ColorToBrushConvert} -->
  93. </Path>
  94. </Grid>
  95. </Border>
  96. <Border
  97. Width="162"
  98. Height="32"
  99. Margin="0,12,0,0"
  100. BorderBrush="#FFE2E3E6"
  101. BorderThickness="1">
  102. <Grid Name="ToolGrid">
  103. <Grid.ColumnDefinitions>
  104. <ColumnDefinition Width="40.5" />
  105. <ColumnDefinition Width="40.5" />
  106. <ColumnDefinition Width="40.5" />
  107. <ColumnDefinition Width="40.5" />
  108. </Grid.ColumnDefinitions>
  109. <ToggleButton
  110. Name="SharpRectBtn"
  111. Width="40.5"
  112. Background="Transparent"
  113. BorderThickness="0"
  114. Click="SharpsBtn_Click"
  115. Command="{Binding SharpsTypeCommand}"
  116. CommandParameter="{Binding ElementName=SharpRectBtn, Path=Tag}"
  117. Tag="Rect">
  118. <Rectangle
  119. Width="16"
  120. Height="16"
  121. HorizontalAlignment="Center"
  122. VerticalAlignment="Center"
  123. Stroke="#273C62" />
  124. </ToggleButton>
  125. <Line
  126. Name="line1"
  127. Grid.Column="1"
  128. HorizontalAlignment="Left"
  129. VerticalAlignment="Center"
  130. Stroke="#33000000"
  131. StrokeThickness="1"
  132. X1="0"
  133. X2="0"
  134. Y1="0"
  135. Y2="16" />
  136. <ToggleButton
  137. Name="SharpCircleBtn"
  138. Grid.Column="1"
  139. Width="40.5"
  140. Margin="0,0,0,0"
  141. Background="Transparent"
  142. BorderThickness="0"
  143. Click="SharpsBtn_Click"
  144. Command="{Binding SharpsTypeCommand}"
  145. CommandParameter="{Binding ElementName=SharpCircleBtn, Path=Tag}"
  146. Tag="Circle">
  147. <Ellipse
  148. Width="16"
  149. Height="16"
  150. HorizontalAlignment="Center"
  151. VerticalAlignment="Center"
  152. Stroke="#273C62" />
  153. </ToggleButton>
  154. <Line
  155. Name="line2"
  156. Grid.Column="2"
  157. HorizontalAlignment="Left"
  158. VerticalAlignment="Center"
  159. Stroke="#33000000"
  160. StrokeThickness="1"
  161. Style="{StaticResource line2Style}"
  162. X1="0"
  163. X2="0"
  164. Y1="0"
  165. Y2="16" />
  166. <ToggleButton
  167. Name="SharpArrowBtn"
  168. Grid.Column="2"
  169. Width="40.5"
  170. Background="Transparent"
  171. BorderThickness="0"
  172. Click="SharpsBtn_Click"
  173. Command="{Binding SharpsTypeCommand}"
  174. CommandParameter="{Binding ElementName=SharpArrowBtn, Path=Tag}"
  175. Tag="Arrow">
  176. <Path
  177. Width="16"
  178. Height="16"
  179. HorizontalAlignment="Center"
  180. VerticalAlignment="Center"
  181. Fill="#273C62">
  182. <Path.Data>
  183. M13.4,2.6 L13.4,8 L12.2,8 L12.1997359,4.648 L2.02426407,14.8242641 L1.17573593,13.9757359 L11.3517359,3.799 L8,3.8 L8,2.6 L13.4,2.6 Z
  184. </Path.Data>
  185. </Path>
  186. </ToggleButton>
  187. <Line
  188. x:Name="line3"
  189. Grid.Column="3"
  190. HorizontalAlignment="Left"
  191. VerticalAlignment="Center"
  192. Stroke="#33000000"
  193. StrokeThickness="1"
  194. Style="{StaticResource line3Style}"
  195. X1="0"
  196. X2="0"
  197. Y1="0"
  198. Y2="16" />
  199. <ToggleButton
  200. Name="SharpLineBtn"
  201. Grid.Column="3"
  202. Width="40.5"
  203. Background="Transparent"
  204. BorderThickness="0"
  205. Click="SharpsBtn_Click"
  206. Command="{Binding SharpsTypeCommand}"
  207. CommandParameter="{Binding ElementName=SharpLineBtn, Path=Tag}"
  208. Tag="Line">
  209. <Polygon
  210. Width="16"
  211. Height="16"
  212. HorizontalAlignment="Center"
  213. VerticalAlignment="Center"
  214. Fill="#273C62">
  215. <Polygon.Points>
  216. 13.1757359 1.97573593 14.0242641 2.82426407 2.82426407 14.0242641 1.97573593 13.1757359
  217. </Polygon.Points>
  218. </Polygon>
  219. </ToggleButton>
  220. </Grid>
  221. </Border>
  222. <Grid x:Name="GridFill" Margin="0,18,0,0">
  223. <Grid.RowDefinitions>
  224. <RowDefinition Height="auto" />
  225. <RowDefinition />
  226. </Grid.RowDefinitions>
  227. <CompositeControl:SlidContent x:Name="layerFill" HorizontalAlignment="Right">
  228. <i:Interaction.Triggers>
  229. <i:EventTrigger EventName="SelectedValueChanged">
  230. <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerFill,Path=Value}"/>
  231. </i:EventTrigger>
  232. </i:Interaction.Triggers>
  233. </CompositeControl:SlidContent>
  234. <CompositeControl:ColorContent x:Name="cusFillColor" Grid.Row="1" />
  235. </Grid>
  236. <Grid Margin="0,18,0,0">
  237. <Grid.RowDefinitions>
  238. <RowDefinition Height="auto" />
  239. <RowDefinition />
  240. </Grid.RowDefinitions>
  241. <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right" />
  242. <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" />
  243. </Grid>
  244. <Grid>
  245. <Grid.ColumnDefinitions>
  246. <ColumnDefinition Width="*" />
  247. <ColumnDefinition Width="auto" />
  248. </Grid.ColumnDefinitions>
  249. <Slider
  250. Name="BorderSlider"
  251. Margin="12,0,4,0"
  252. VerticalAlignment="Center"
  253. IsMoveToPointEnabled="True"
  254. IsSelectionRangeEnabled="True"
  255. IsSnapToTickEnabled="True"
  256. Maximum="12"
  257. Minimum="1"
  258. Style="{StaticResource RoundThumbSlider}"
  259. TickFrequency="1"
  260. Value="{Binding LineWidth}">
  261. <Slider.Resources>
  262. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
  263. <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
  264. </Slider.Resources>
  265. </Slider>
  266. <Border
  267. Grid.Column="1"
  268. Width="80"
  269. Height="32"
  270. Margin="0,0,12,0"
  271. BorderBrush="#E2E3E6"
  272. BorderThickness="0">
  273. <Grid>
  274. <ComboBox
  275. Name="BorderDropBox"
  276. Padding="10,10,0,0"
  277. Background="Transparent"
  278. BorderBrush="#FFE2E3E6"
  279. BorderThickness="1">
  280. <ComboBox.ItemContainerStyle>
  281. <Style TargetType="{x:Type ComboBoxItem}">
  282. <Setter Property="Padding" Value="10,0,0,0" />
  283. </Style>
  284. </ComboBox.ItemContainerStyle>
  285. <ComboBoxItem
  286. Height="32"
  287. VerticalContentAlignment="Center"
  288. Content="1"
  289. Template="{StaticResource comboxitem}" />
  290. <ComboBoxItem
  291. Height="32"
  292. VerticalContentAlignment="Center"
  293. Content="3"
  294. Template="{StaticResource comboxitem}" />
  295. <ComboBoxItem
  296. Height="32"
  297. VerticalContentAlignment="Center"
  298. Content="6"
  299. Template="{StaticResource comboxitem}" />
  300. <ComboBoxItem
  301. Height="32"
  302. VerticalContentAlignment="Center"
  303. Content="9"
  304. Template="{StaticResource comboxitem}" />
  305. <ComboBoxItem
  306. Height="32"
  307. VerticalContentAlignment="Center"
  308. Content="12"
  309. Template="{StaticResource comboxitem}" />
  310. <i:Interaction.Triggers>
  311. <i:EventTrigger EventName="SelectionChanged">
  312. <i:InvokeCommandAction Command="{Binding ThicknessChangedCommand}" CommandParameter="{Binding ElementName=BorderDropBox, Path=SelectedItem}" />
  313. </i:EventTrigger>
  314. </i:Interaction.Triggers>
  315. </ComboBox>
  316. <TextBox
  317. Height="20"
  318. Margin="10,0,35,0"
  319. VerticalAlignment="Center"
  320. Background="White"
  321. BorderThickness="0"
  322. FontFamily="Segoe UI"
  323. FontSize="14"
  324. IsReadOnly="True"
  325. Text="{Binding ElementName=BorderSlider, Path=Value}"
  326. TextAlignment="Left" />
  327. </Grid>
  328. </Border>
  329. </Grid>
  330. <StackPanel x:Name="PnlLineStyle" Orientation="Horizontal" Margin="0,20,0,0">
  331. <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
  332. Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
  333. VerticalContentAlignment="Center" Background="Transparent"
  334. Style="{DynamicResource GreyBgRadioBtnStyle}">
  335. <RadioButton.Content>
  336. <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
  337. </RadioButton.Content>
  338. <i:Interaction.Triggers>
  339. <i:EventTrigger EventName="Checked">
  340. <i:InvokeCommandAction Command="{Binding LineStyleCommand}" CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}" />
  341. </i:EventTrigger>
  342. </i:Interaction.Triggers>
  343. </RadioButton>
  344. <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
  345. Width="105" Height="32" Margin="0,0" Foreground="#616469"
  346. VerticalContentAlignment="Center" Background="Transparent"
  347. Style="{DynamicResource GreyBgRadioBtnStyle}">
  348. <RadioButton.Content>
  349. <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
  350. </RadioButton.Content>
  351. <i:Interaction.Triggers>
  352. <i:EventTrigger EventName="Checked">
  353. <i:InvokeCommandAction Command="{Binding LineStyleCommand}" CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}" />
  354. </i:EventTrigger>
  355. </i:Interaction.Triggers>
  356. </RadioButton>
  357. </StackPanel>
  358. </StackPanel>
  359. </Grid>
  360. </UserControl>