FreetextAnnotProperty.xaml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.FreetextAnnotProperty"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
  7. xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  8. xmlns:cusColor="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  9. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:prism="http://prismlibrary.com/"
  11. prism:ViewModelLocator.AutoWireViewModel="True"
  12. xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
  13. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  14. mc:Ignorable="d"
  15. d:DesignHeight="850" d:DesignWidth="800">
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
  20. <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
  21. </ResourceDictionary.MergedDictionaries>
  22. <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert"/>
  23. <Style x:Key="line1Style" TargetType="{x:Type Line}">
  24. <Setter Property="Visibility">
  25. <Setter.Value>
  26. <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
  27. <Binding ElementName="TextAlignLeftBtn" Path="IsChecked"/>
  28. <Binding ElementName="TextAlignCenterBtn" Path="IsChecked"/>
  29. </MultiBinding>
  30. </Setter.Value>
  31. </Setter>
  32. </Style>
  33. <Style x:Key="line2Style" TargetType="{x:Type Line}">
  34. <Setter Property="Visibility">
  35. <Setter.Value>
  36. <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
  37. <Binding ElementName="TextAlignCenterBtn" Path="IsChecked"/>
  38. <Binding ElementName="TextAlignRightBtn" Path="IsChecked"/>
  39. </MultiBinding>
  40. </Setter.Value>
  41. </Setter>
  42. </Style>
  43. <DataTemplate x:Key="FontStyleData">
  44. <Grid >
  45. <TextBlock Text="{Binding mFontStyleName}" Foreground="Black"/>
  46. </Grid>
  47. </DataTemplate>
  48. </ResourceDictionary>
  49. </UserControl.Resources>
  50. <Grid Background="#F3F3F3">
  51. <StackPanel>
  52. <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freetext</TextBlock>
  53. <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
  54. <Grid>
  55. <Border Name="FreeTextBorder" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5"
  56. Opacity="{Binding FillOpacity}"
  57. Background="{Binding FillColor}">
  58. <TextBlock Name="SampleText"
  59. Foreground="{Binding SelectColor}"
  60. FontFamily="{Binding CurrentFontFamily.ValueStr}"
  61. FontWeight="{Binding FontWeightItem}"
  62. FontStyle="{Binding FontStyleItem}"
  63. FontSize="{Binding CurrentFontSize.Value}" Opacity="{Binding FillOpacity}"
  64. Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center">
  65. </TextBlock>
  66. </Border>
  67. <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
  68. <Path.Data>
  69. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  70. </Path.Data>
  71. </Path>
  72. <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,40,0,0" Visibility="Collapsed">
  73. <Path.Data>
  74. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  75. </Path.Data>
  76. </Path>
  77. <Path Name="SquigglyPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
  78. </Path>
  79. </Grid>
  80. </Border>
  81. <Border
  82. Height="32"
  83. Margin="15,8,15,18"
  84. BorderBrush="#E2E3E6"
  85. BorderThickness="0">
  86. <Grid>
  87. <Grid.ColumnDefinitions>
  88. <ColumnDefinition/>
  89. <ColumnDefinition Width="auto"/>
  90. </Grid.ColumnDefinitions>
  91. <CompositeControl:CustomComboControl
  92. x:Name="FontTitleBox"
  93. Width="188"
  94. Height="32"
  95. HorizontalAlignment="Left"
  96. IsValueContent="True"
  97. ItemSource="{Binding PresetFontItems}"
  98. SelectedItems="{Binding CurrentPresetFont, Mode=TwoWay}" />
  99. <Button Grid.Column="1"
  100. Width="32"
  101. Height="32"
  102. HorizontalAlignment="Left" Command="{Binding CustomFontStyleCommand}"
  103. Style="{StaticResource btn.sec}">
  104. <Path
  105. Width="16"
  106. Height="16"
  107. Data="M4 8C4 8.82843 3.32843 9.5 2.5 9.5C1.67157 9.5 1 8.82843 1 8C1 7.17157 1.67157 6.5 2.5 6.5C3.32843 6.5 4 7.17157 4 8ZM9.3999 8C9.3999 8.82843 8.72833 9.5 7.8999 9.5C7.07148 9.5 6.3999 8.82843 6.3999 8C6.3999 7.17157 7.07148 6.5 7.8999 6.5C8.72833 6.5 9.3999 7.17157 9.3999 8ZM13.5 9.5C14.3284 9.5 15 8.82843 15 8C15 7.17157 14.3284 6.5 13.5 6.5C12.6716 6.5 12 7.17157 12 8C12 8.82843 12.6716 9.5 13.5 9.5Z"
  108. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  109. </Button>
  110. </Grid>
  111. </Border>
  112. <StackPanel Margin="15,0,15,0">
  113. <TextBlock
  114. Margin="0,0,0,10"
  115. Style="{StaticResource PropertyHeaderLv2}"
  116. Text="文本" />
  117. <StackPanel>
  118. <CompositeControl:CustomComboControl
  119. x:Name="FontFamilyBox"
  120. Height="32"
  121. IsValueContent="True"
  122. ItemSource="{Binding FontFamilyItems}"
  123. IsSelectedEmpty ="{Binding IsSelectedEmpty}"
  124. SelectedItems="{Binding CurrentFontFamily, Mode=TwoWay}" />
  125. <Grid Margin="0,8">
  126. <CompositeControl:CustomComboControl
  127. x:Name="FontStyleBox"
  128. Width="110"
  129. Height="32"
  130. HorizontalAlignment="Left"
  131. IsValueContent="True"
  132. ItemSource="{Binding FontStyleItems}"
  133. IsSelectedEmpty ="{Binding IsSelectedEmpty}"
  134. SelectedItems="{Binding CurrrentFontWeightStyle, Mode=TwoWay}" />
  135. <CompositeControl:CustomComboControl
  136. x:Name="FontSizeBox"
  137. Width="110"
  138. Height="32"
  139. HorizontalAlignment="Right"
  140. IsSelectedEmpty ="{Binding IsSelectedEmpty}"
  141. SelectedItems="{Binding CurrentFontSize, Mode=TwoWay}" />
  142. </Grid>
  143. <Grid>
  144. <StackPanel Orientation="Horizontal">
  145. <RadioButton
  146. x:Name="TextAlignLeftBtn"
  147. Width="32"
  148. Height="32"
  149. VerticalContentAlignment="Center"
  150. Background="Transparent"
  151. Foreground="#616469"
  152. GroupName="TextAlign"
  153. IsChecked="True"
  154. Style="{DynamicResource GreyBgRadioBtnStyle}"
  155. Tag="AlignLeft">
  156. <RadioButton.Content>
  157. <Grid Width="32" Height="32">
  158. <Canvas Margin="5,10,0,0">
  159. <Rectangle
  160. Canvas.Top="0.25"
  161. Width="14"
  162. Height="1.5"
  163. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  164. StrokeThickness="1.5" />
  165. <Rectangle
  166. Canvas.Top="4.25"
  167. Width="8"
  168. Height="1.5"
  169. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  170. StrokeThickness="1.5" />
  171. <Rectangle
  172. Canvas.Top="12.25"
  173. Width="8"
  174. Height="1.5"
  175. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  176. StrokeThickness="1.5" />
  177. <Rectangle
  178. Canvas.Top="8.25"
  179. Width="14"
  180. Height="1.5"
  181. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  182. StrokeThickness="1.5" />
  183. </Canvas>
  184. </Grid>
  185. </RadioButton.Content>
  186. <i:Interaction.Triggers>
  187. <i:EventTrigger EventName="Checked">
  188. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn, Path=Tag}" />
  189. </i:EventTrigger>
  190. </i:Interaction.Triggers>
  191. </RadioButton>
  192. <RadioButton
  193. x:Name="TextAlignCenterBtn"
  194. Width="32"
  195. Height="32"
  196. Margin="8,0"
  197. VerticalContentAlignment="Center"
  198. Background="Transparent"
  199. Foreground="#616469"
  200. GroupName="TextAlign"
  201. Style="{DynamicResource GreyBgRadioBtnStyle}"
  202. Tag="AlignCenter">
  203. <RadioButton.Content>
  204. <Grid Width="32" Height="32">
  205. <Canvas Margin="5,10,0,0">
  206. <Rectangle
  207. Canvas.Top="0.25"
  208. Width="14"
  209. Height="1.5"
  210. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  211. StrokeThickness="1.5" />
  212. <Rectangle
  213. Canvas.Left="3"
  214. Canvas.Top="4.25"
  215. Width="8"
  216. Height="1.5"
  217. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  218. StrokeThickness="1.5" />
  219. <Rectangle
  220. Canvas.Left="3"
  221. Canvas.Top="12.25"
  222. Width="8"
  223. Height="1.5"
  224. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  225. StrokeThickness="1.5" />
  226. <Rectangle
  227. Canvas.Top="8.25"
  228. Width="14"
  229. Height="1.5"
  230. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  231. StrokeThickness="1.5" />
  232. </Canvas>
  233. </Grid>
  234. </RadioButton.Content>
  235. <i:Interaction.Triggers>
  236. <i:EventTrigger EventName="Checked">
  237. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn, Path=Tag}" />
  238. </i:EventTrigger>
  239. </i:Interaction.Triggers>
  240. </RadioButton>
  241. <RadioButton
  242. x:Name="TextAlignRightBtn"
  243. Grid.Column="2"
  244. Width="32"
  245. Height="32"
  246. VerticalContentAlignment="Center"
  247. Background="Transparent"
  248. Foreground="#616469"
  249. GroupName="TextAlign"
  250. Style="{DynamicResource GreyBgRadioBtnStyle}"
  251. Tag="AlignRight">
  252. <RadioButton.Content>
  253. <Grid Width="32" Height="32">
  254. <Canvas Margin="5,10,0,0">
  255. <Rectangle
  256. Canvas.Top="0.25"
  257. Width="14"
  258. Height="1.5"
  259. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  260. StrokeThickness="1.5" />
  261. <Rectangle
  262. Canvas.Left="6"
  263. Canvas.Top="4.25"
  264. Width="8"
  265. Height="1.5"
  266. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  267. StrokeThickness="1.5" />
  268. <Rectangle
  269. Canvas.Left="6"
  270. Canvas.Top="12.25"
  271. Width="8"
  272. Height="1.5"
  273. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  274. StrokeThickness="1.5" />
  275. <Rectangle
  276. Canvas.Top="8.25"
  277. Width="14"
  278. Height="1.5"
  279. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  280. StrokeThickness="1.5" />
  281. </Canvas>
  282. </Grid>
  283. </RadioButton.Content>
  284. <i:Interaction.Triggers>
  285. <i:EventTrigger EventName="Checked">
  286. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn, Path=Tag}" />
  287. </i:EventTrigger>
  288. </i:Interaction.Triggers>
  289. </RadioButton>
  290. <RadioButton
  291. x:Name="TextAlignBtn"
  292. Grid.Column="3"
  293. Width="32"
  294. Height="32"
  295. Margin="8,0"
  296. VerticalContentAlignment="Center"
  297. Background="Transparent"
  298. Foreground="#616469"
  299. GroupName="TextAlign"
  300. Style="{DynamicResource GreyBgRadioBtnStyle}"
  301. Tag="Align">
  302. <RadioButton.Content>
  303. <Grid Width="32" Height="32">
  304. <Canvas Margin="5,10,0,0">
  305. <Rectangle
  306. Canvas.Top="0.25"
  307. Width="14"
  308. Height="1.5"
  309. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  310. StrokeThickness="1.5" />
  311. <Rectangle
  312. Canvas.Top="8.25"
  313. Width="14"
  314. Height="1.5"
  315. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  316. StrokeThickness="1.5" />
  317. <Rectangle
  318. Canvas.Top="4.25"
  319. Width="14"
  320. Height="1.5"
  321. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  322. StrokeThickness="1.5" />
  323. <Rectangle
  324. Canvas.Top="12.25"
  325. Width="14"
  326. Height="1.5"
  327. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  328. StrokeThickness="1.5" />
  329. </Canvas>
  330. </Grid>
  331. </RadioButton.Content>
  332. <i:Interaction.Triggers>
  333. <i:EventTrigger EventName="Checked">
  334. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn, Path=Tag}" />
  335. </i:EventTrigger>
  336. </i:Interaction.Triggers>
  337. </RadioButton>
  338. </StackPanel>
  339. <cusColor:ColorContent
  340. x:Name="FontColorBox"
  341. Width="56"
  342. HorizontalAlignment="Right"
  343. ShowColorList="Collapsed" />
  344. </Grid>
  345. </StackPanel>
  346. </StackPanel>
  347. <Grid Margin="15,18,15,0">
  348. <Grid.RowDefinitions>
  349. <RowDefinition Height="auto"/>
  350. <RowDefinition/>
  351. </Grid.RowDefinitions>
  352. <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right">
  353. <i:Interaction.Triggers>
  354. <i:EventTrigger EventName="SelectedValueChanged">
  355. <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}"/>
  356. </i:EventTrigger>
  357. </i:Interaction.Triggers>
  358. </CompositeControl:SlidContent>
  359. <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"/>
  360. </Grid>
  361. <!--MVP不上-->
  362. <TextBlock x:Name="thicknessText" Visibility="Collapsed" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
  363. <Grid Visibility="Collapsed">
  364. <Grid.ColumnDefinitions>
  365. <ColumnDefinition Width="*"></ColumnDefinition>
  366. <ColumnDefinition Width="auto"></ColumnDefinition>
  367. </Grid.ColumnDefinitions>
  368. <Slider Name="ThicknessSlider" VerticalAlignment="Center" Margin="12,0,0,0" Width="148" Minimum="0" Maximum="24" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True"
  369. Style="{StaticResource RoundThumbSlider}" TickFrequency="1" IsSnapToTickEnabled="True" >
  370. <Slider.Resources>
  371. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
  372. <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
  373. </Slider.Resources>
  374. </Slider>
  375. <Border Grid.Column="1" BorderBrush="#E2E3E6" Width="80" Height="32" Margin="0,0,11,0" BorderThickness="0">
  376. <Grid>
  377. <ComboBox Name="ThicknessBox" BorderThickness="1" Padding="10" Background="Transparent" BorderBrush="#FFE2E3E6"
  378. MaxDropDownHeight="200">
  379. <ComboBox.ItemContainerStyle>
  380. <Style TargetType="{x:Type ComboBoxItem}">
  381. <Setter Property="Padding" Value="10 0 0 0"/>
  382. </Style>
  383. </ComboBox.ItemContainerStyle>
  384. <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  385. <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  386. <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  387. <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  388. <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  389. <ComboBoxItem Content="15" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  390. <ComboBoxItem Content="18" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  391. <ComboBoxItem Content="21" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  392. <ComboBoxItem Content="24" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  393. </ComboBox>
  394. <TextBox Name="ThicknessText" Background="White" FontFamily="Segoe UI" FontSize="14" Height="20" Margin="10,0,35,0" IsReadOnly="True"
  395. BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" >
  396. </TextBox>
  397. </Grid>
  398. </Border>
  399. </Grid>
  400. <StackPanel Visibility="Collapsed" Orientation="Horizontal" Margin="0,20,0,0">
  401. <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
  402. Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
  403. VerticalContentAlignment="Center" Background="Transparent"
  404. Style="{DynamicResource GreyBgRadioBtnStyle}">
  405. <RadioButton.Content>
  406. <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
  407. </RadioButton.Content>
  408. <i:Interaction.Triggers>
  409. <i:EventTrigger EventName="Checked">
  410. <i:InvokeCommandAction Command="{Binding LineModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}" />
  411. </i:EventTrigger>
  412. </i:Interaction.Triggers>
  413. </RadioButton>
  414. <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
  415. Width="105" Height="32" Margin="0,0" Foreground="#616469"
  416. VerticalContentAlignment="Center" Background="Transparent"
  417. Style="{DynamicResource GreyBgRadioBtnStyle}">
  418. <RadioButton.Content>
  419. <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
  420. </RadioButton.Content>
  421. <i:Interaction.Triggers>
  422. <i:EventTrigger EventName="Checked">
  423. <i:InvokeCommandAction Command="{Binding LineModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}" />
  424. </i:EventTrigger>
  425. </i:Interaction.Triggers>
  426. </RadioButton>
  427. </StackPanel>
  428. </StackPanel>
  429. </Grid>
  430. </UserControl>