SharpsAnnotProperty.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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. <CompositeControl:ColorContent x:Name="cusFillColor" Grid.Row="1" />
  229. </Grid>
  230. <Grid Margin="0,18,0,0">
  231. <Grid.RowDefinitions>
  232. <RowDefinition Height="auto" />
  233. <RowDefinition />
  234. </Grid.RowDefinitions>
  235. <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right" />
  236. <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" />
  237. </Grid>
  238. <Grid>
  239. <Grid.ColumnDefinitions>
  240. <ColumnDefinition Width="*" />
  241. <ColumnDefinition Width="auto" />
  242. </Grid.ColumnDefinitions>
  243. <Slider
  244. Name="BorderSlider"
  245. Margin="12,0,4,0"
  246. VerticalAlignment="Center"
  247. IsMoveToPointEnabled="True"
  248. IsSelectionRangeEnabled="True"
  249. IsSnapToTickEnabled="True"
  250. Maximum="12"
  251. Minimum="1"
  252. Style="{StaticResource RoundThumbSlider}"
  253. TickFrequency="1"
  254. Value="{Binding LineWidth}">
  255. <Slider.Resources>
  256. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
  257. <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
  258. </Slider.Resources>
  259. </Slider>
  260. <Border
  261. Grid.Column="1"
  262. Width="80"
  263. Height="32"
  264. Margin="0,0,12,0"
  265. BorderBrush="#E2E3E6"
  266. BorderThickness="0">
  267. <Grid>
  268. <ComboBox
  269. Name="BorderDropBox"
  270. Padding="10,10,0,0"
  271. Background="Transparent"
  272. BorderBrush="#FFE2E3E6"
  273. BorderThickness="1">
  274. <ComboBox.ItemContainerStyle>
  275. <Style TargetType="{x:Type ComboBoxItem}">
  276. <Setter Property="Padding" Value="10,0,0,0" />
  277. </Style>
  278. </ComboBox.ItemContainerStyle>
  279. <ComboBoxItem
  280. Height="32"
  281. VerticalContentAlignment="Center"
  282. Content="1"
  283. Template="{StaticResource comboxitem}" />
  284. <ComboBoxItem
  285. Height="32"
  286. VerticalContentAlignment="Center"
  287. Content="3"
  288. Template="{StaticResource comboxitem}" />
  289. <ComboBoxItem
  290. Height="32"
  291. VerticalContentAlignment="Center"
  292. Content="6"
  293. Template="{StaticResource comboxitem}" />
  294. <ComboBoxItem
  295. Height="32"
  296. VerticalContentAlignment="Center"
  297. Content="9"
  298. Template="{StaticResource comboxitem}" />
  299. <ComboBoxItem
  300. Height="32"
  301. VerticalContentAlignment="Center"
  302. Content="12"
  303. Template="{StaticResource comboxitem}" />
  304. <i:Interaction.Triggers>
  305. <i:EventTrigger EventName="SelectionChanged">
  306. <i:InvokeCommandAction Command="{Binding ThicknessChangedCommand}" CommandParameter="{Binding ElementName=BorderDropBox, Path=SelectedItem}" />
  307. </i:EventTrigger>
  308. </i:Interaction.Triggers>
  309. </ComboBox>
  310. <TextBox
  311. Height="20"
  312. Margin="10,0,35,0"
  313. VerticalAlignment="Center"
  314. Background="White"
  315. BorderThickness="0"
  316. FontFamily="Segoe UI"
  317. FontSize="14"
  318. IsReadOnly="True"
  319. Text="{Binding ElementName=BorderSlider, Path=Value}"
  320. TextAlignment="Left" />
  321. </Grid>
  322. </Border>
  323. </Grid>
  324. <StackPanel
  325. x:Name="PnlLineStyle"
  326. Margin="0,20,0,0"
  327. Orientation="Horizontal">
  328. <cus:CustomIconToggleBtn
  329. x:Name="BtnSolidLine"
  330. Width="110"
  331. Height="32"
  332. Click="BtnLineStyle_Click"
  333. Command="{Binding LineStyleCommand}"
  334. CommandParameter="{Binding ElementName=BtnSolidLine, Path=Tag}"
  335. Style="{StaticResource ToggleBtnViewModeStyle}"
  336. Tag="Solid">
  337. <Border
  338. Width="108"
  339. Height="30"
  340. Padding="8,0,8,0"
  341. BorderBrush="Black"
  342. BorderThickness="1">
  343. <Line
  344. Stroke="Black"
  345. StrokeThickness="2"
  346. X1="10"
  347. X2="260"
  348. Y1="15"
  349. Y2="15" />
  350. </Border>
  351. </cus:CustomIconToggleBtn>
  352. <cus:CustomIconToggleBtn
  353. x:Name="BtnDottedLine"
  354. Width="110"
  355. Height="32"
  356. Click="BtnLineStyle_Click"
  357. Command="{Binding LineStyleCommand}"
  358. CommandParameter="{Binding ElementName=BtnDottedLine, Path=Tag}"
  359. Style="{StaticResource ToggleBtnViewModeStyle}"
  360. Tag="Dotted">
  361. <Border
  362. Width="108"
  363. Height="30"
  364. Padding="8,0,8,0"
  365. BorderBrush="Black"
  366. BorderThickness="1">
  367. <Line
  368. Stroke="Black"
  369. StrokeDashArray="2"
  370. StrokeThickness="2"
  371. X1="10"
  372. X2="260"
  373. Y1="15"
  374. Y2="15" />
  375. </Border>
  376. </cus:CustomIconToggleBtn>
  377. </StackPanel>
  378. </StackPanel>
  379. </Grid>
  380. </UserControl>