SharpsAnnotProperty.xaml 18 KB

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