FreetextAnnotProperty.xaml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  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. <ContextMenu x:Key="BtnFlyoutMenu" FontSize="14"
  44. >
  45. <ContextMenu.ItemContainerStyle>
  46. <Style TargetType="MenuItem">
  47. <Setter Property="Padding" Value="0,7,0,7"/>
  48. <Setter Property="VerticalContentAlignment" Value="Center"/>
  49. </Style>
  50. </ContextMenu.ItemContainerStyle>
  51. <MenuItem Name="ChangeStyleMenuItem" Header="用所选部分重新定义" IsEnabled="True">
  52. </MenuItem>
  53. <MenuItem Name="BackStyleMenuItem" Header="恢复默认预设样式" IsEnabled="True">
  54. </MenuItem>
  55. </ContextMenu>
  56. <DataTemplate x:Key="FontStyleData">
  57. <Grid >
  58. <TextBlock Text="{Binding mFontStyleName}" Foreground="Black"/>
  59. </Grid>
  60. </DataTemplate>
  61. </ResourceDictionary>
  62. </UserControl.Resources>
  63. <Grid Background="#F3F3F3">
  64. <StackPanel>
  65. <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freetext</TextBlock>
  66. <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
  67. <Grid>
  68. <Border Name="FreeTextBorder" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5"
  69. Opacity="{Binding FillOpacity}"
  70. Background="{Binding FillColor}">
  71. <TextBlock Name="SampleText"
  72. Foreground="{Binding SelectColor}"
  73. FontFamily="{Binding TextFontFamily}"
  74. FontWeight="{Binding TextFontWeights}"
  75. FontStyle="{Binding TextFontStyle}"
  76. FontSize="{Binding TextFontSize}" Opacity="{Binding FillOpacity}"
  77. Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center">
  78. </TextBlock>
  79. </Border>
  80. <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
  81. <Path.Data>
  82. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  83. </Path.Data>
  84. </Path>
  85. <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,40,0,0" Visibility="Collapsed">
  86. <Path.Data>
  87. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  88. </Path.Data>
  89. </Path>
  90. <Path Name="SquigglyPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
  91. </Path>
  92. </Grid>
  93. </Border>
  94. <Border
  95. Height="32"
  96. Margin="0,8,0,18"
  97. BorderBrush="#E2E3E6"
  98. BorderThickness="0">
  99. <Grid>
  100. <CompositeControl:CustomComboControl
  101. x:Name="FontTitleBox"
  102. Width="188"
  103. Height="32"
  104. HorizontalAlignment="Left"
  105. IsValueContent="True"
  106. ItemSource="{Binding PresetTextItems}"
  107. SelectedItems="{Binding PresetTextData, Mode=TwoWay}" />
  108. <Button
  109. Width="32"
  110. Height="32"
  111. HorizontalAlignment="Right"
  112. ContextMenu="{StaticResource BtnFlyoutMenu}"
  113. Style="{StaticResource btn.sec}">
  114. <Path
  115. Width="16"
  116. Height="16"
  117. 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"
  118. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  119. </Button>
  120. </Grid>
  121. </Border>
  122. <TextBlock x:Name="FontText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,18,0,0" >Font</TextBlock>
  123. <StackPanel>
  124. <TextBlock
  125. Margin="0,0,0,10"
  126. Style="{StaticResource PropertyHeaderLv2}"
  127. Text="文本" />
  128. <StackPanel>
  129. <CompositeControl:CustomComboControl
  130. x:Name="FontFamilyBox"
  131. Height="32"
  132. IsValueContent="True"
  133. ItemSource="{Binding FontFamilyItems}"
  134. SelectedItems="{Binding FontFamilyData, Mode=TwoWay}" />
  135. <Grid Margin="0,8">
  136. <CompositeControl:CustomComboControl
  137. x:Name="FontStyleBox"
  138. Width="110"
  139. Height="32"
  140. HorizontalAlignment="Left"
  141. IsValueContent="True"
  142. ItemSource="{Binding FontStyleItems}"
  143. SelectedItems="{Binding FontWeightStyleItem, Mode=TwoWay}" />
  144. <CompositeControl:CustomComboControl
  145. x:Name="FontSizeBox"
  146. Width="110"
  147. Height="32"
  148. HorizontalAlignment="Right"
  149. SelectedItems="{Binding FontSizeData, Mode=TwoWay}" />
  150. </Grid>
  151. <Grid>
  152. <StackPanel Orientation="Horizontal">
  153. <RadioButton
  154. x:Name="TextAlignLeftBtn"
  155. Width="32"
  156. Height="32"
  157. VerticalContentAlignment="Center"
  158. Background="Transparent"
  159. Foreground="#616469"
  160. GroupName="TextAlign"
  161. IsChecked="True"
  162. Style="{DynamicResource GreyBgRadioBtnStyle}"
  163. Tag="AlignLeft">
  164. <RadioButton.Content>
  165. <Grid Width="32" Height="32">
  166. <Canvas Margin="5,10,0,0">
  167. <Rectangle
  168. Canvas.Top="0.25"
  169. Width="14"
  170. Height="1.5"
  171. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  172. StrokeThickness="1.5" />
  173. <Rectangle
  174. Canvas.Top="4.25"
  175. Width="8"
  176. Height="1.5"
  177. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  178. StrokeThickness="1.5" />
  179. <Rectangle
  180. Canvas.Top="12.25"
  181. Width="8"
  182. Height="1.5"
  183. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  184. StrokeThickness="1.5" />
  185. <Rectangle
  186. Canvas.Top="8.25"
  187. Width="14"
  188. Height="1.5"
  189. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  190. StrokeThickness="1.5" />
  191. </Canvas>
  192. </Grid>
  193. </RadioButton.Content>
  194. <i:Interaction.Triggers>
  195. <i:EventTrigger EventName="Checked">
  196. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn, Path=Tag}" />
  197. </i:EventTrigger>
  198. </i:Interaction.Triggers>
  199. </RadioButton>
  200. <RadioButton
  201. x:Name="TextAlignCenterBtn"
  202. Width="32"
  203. Height="32"
  204. Margin="8,0"
  205. VerticalContentAlignment="Center"
  206. Background="Transparent"
  207. Foreground="#616469"
  208. GroupName="TextAlign"
  209. Style="{DynamicResource GreyBgRadioBtnStyle}"
  210. Tag="AlignCenter">
  211. <RadioButton.Content>
  212. <Grid Width="32" Height="32">
  213. <Canvas Margin="5,10,0,0">
  214. <Rectangle
  215. Canvas.Top="0.25"
  216. Width="14"
  217. Height="1.5"
  218. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  219. StrokeThickness="1.5" />
  220. <Rectangle
  221. Canvas.Left="3"
  222. Canvas.Top="4.25"
  223. Width="8"
  224. Height="1.5"
  225. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  226. StrokeThickness="1.5" />
  227. <Rectangle
  228. Canvas.Left="3"
  229. Canvas.Top="12.25"
  230. Width="8"
  231. Height="1.5"
  232. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  233. StrokeThickness="1.5" />
  234. <Rectangle
  235. Canvas.Top="8.25"
  236. Width="14"
  237. Height="1.5"
  238. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  239. StrokeThickness="1.5" />
  240. </Canvas>
  241. </Grid>
  242. </RadioButton.Content>
  243. <i:Interaction.Triggers>
  244. <i:EventTrigger EventName="Checked">
  245. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn, Path=Tag}" />
  246. </i:EventTrigger>
  247. </i:Interaction.Triggers>
  248. </RadioButton>
  249. <RadioButton
  250. x:Name="TextAlignRightBtn"
  251. Grid.Column="2"
  252. Width="32"
  253. Height="32"
  254. VerticalContentAlignment="Center"
  255. Background="Transparent"
  256. Foreground="#616469"
  257. GroupName="TextAlign"
  258. Style="{DynamicResource GreyBgRadioBtnStyle}"
  259. Tag="AlignRight">
  260. <RadioButton.Content>
  261. <Grid Width="32" Height="32">
  262. <Canvas Margin="5,10,0,0">
  263. <Rectangle
  264. Canvas.Top="0.25"
  265. Width="14"
  266. Height="1.5"
  267. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  268. StrokeThickness="1.5" />
  269. <Rectangle
  270. Canvas.Left="6"
  271. Canvas.Top="4.25"
  272. Width="8"
  273. Height="1.5"
  274. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  275. StrokeThickness="1.5" />
  276. <Rectangle
  277. Canvas.Left="6"
  278. Canvas.Top="12.25"
  279. Width="8"
  280. Height="1.5"
  281. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  282. StrokeThickness="1.5" />
  283. <Rectangle
  284. Canvas.Top="8.25"
  285. Width="14"
  286. Height="1.5"
  287. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  288. StrokeThickness="1.5" />
  289. </Canvas>
  290. </Grid>
  291. </RadioButton.Content>
  292. <i:Interaction.Triggers>
  293. <i:EventTrigger EventName="Checked">
  294. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn, Path=Tag}" />
  295. </i:EventTrigger>
  296. </i:Interaction.Triggers>
  297. </RadioButton>
  298. <RadioButton
  299. x:Name="TextAlignBtn"
  300. Grid.Column="3"
  301. Width="32"
  302. Height="32"
  303. Margin="8,0"
  304. VerticalContentAlignment="Center"
  305. Background="Transparent"
  306. Foreground="#616469"
  307. GroupName="TextAlign"
  308. Style="{DynamicResource GreyBgRadioBtnStyle}"
  309. Tag="Align">
  310. <RadioButton.Content>
  311. <Grid Width="32" Height="32">
  312. <Canvas Margin="5,10,0,0">
  313. <Rectangle
  314. Canvas.Top="0.25"
  315. Width="14"
  316. Height="1.5"
  317. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  318. StrokeThickness="1.5" />
  319. <Rectangle
  320. Canvas.Top="8.25"
  321. Width="14"
  322. Height="1.5"
  323. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  324. StrokeThickness="1.5" />
  325. <Rectangle
  326. Canvas.Top="4.25"
  327. Width="14"
  328. Height="1.5"
  329. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  330. StrokeThickness="1.5" />
  331. <Rectangle
  332. Canvas.Top="12.25"
  333. Width="14"
  334. Height="1.5"
  335. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  336. StrokeThickness="1.5" />
  337. </Canvas>
  338. </Grid>
  339. </RadioButton.Content>
  340. <i:Interaction.Triggers>
  341. <i:EventTrigger EventName="Checked">
  342. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn, Path=Tag}" />
  343. </i:EventTrigger>
  344. </i:Interaction.Triggers>
  345. </RadioButton>
  346. </StackPanel>
  347. <cusColor:ColorContent
  348. x:Name="FontColorBox"
  349. Width="56"
  350. HorizontalAlignment="Right"
  351. ShowColorList="Collapsed" />
  352. </Grid>
  353. </StackPanel>
  354. </StackPanel>
  355. <Grid Margin="0,18,0,0">
  356. <Grid.RowDefinitions>
  357. <RowDefinition Height="auto"/>
  358. <RowDefinition/>
  359. </Grid.RowDefinitions>
  360. <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"/>
  361. <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"/>
  362. </Grid>
  363. <!--MVP-->
  364. <TextBlock x:Name="thicknessText" Visibility="Collapsed" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
  365. <Grid Visibility="Collapsed">
  366. <Grid.ColumnDefinitions>
  367. <ColumnDefinition Width="*"></ColumnDefinition>
  368. <ColumnDefinition Width="auto"></ColumnDefinition>
  369. </Grid.ColumnDefinitions>
  370. <Slider Name="ThicknessSlider" VerticalAlignment="Center" Margin="12,0,0,0" Width="148" Minimum="0" Maximum="24" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True"
  371. Style="{StaticResource RoundThumbSlider}" TickFrequency="1" IsSnapToTickEnabled="True" >
  372. <Slider.Resources>
  373. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
  374. <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
  375. </Slider.Resources>
  376. </Slider>
  377. <Border Grid.Column="1" BorderBrush="#E2E3E6" Width="80" Height="32" Margin="0,0,11,0" BorderThickness="0">
  378. <Grid>
  379. <ComboBox Name="ThicknessBox" BorderThickness="1" Padding="10" Background="Transparent" BorderBrush="#FFE2E3E6"
  380. MaxDropDownHeight="200">
  381. <ComboBox.ItemContainerStyle>
  382. <Style TargetType="{x:Type ComboBoxItem}">
  383. <Setter Property="Padding" Value="10 0 0 0"/>
  384. </Style>
  385. </ComboBox.ItemContainerStyle>
  386. <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  387. <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  388. <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  389. <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  390. <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  391. <ComboBoxItem Content="15" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  392. <ComboBoxItem Content="18" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  393. <ComboBoxItem Content="21" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  394. <ComboBoxItem Content="24" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  395. </ComboBox>
  396. <TextBox Name="ThicknessText" Background="White" FontFamily="Segoe UI" FontSize="14" Height="20" Margin="10,0,35,0" IsReadOnly="True"
  397. BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" >
  398. </TextBox>
  399. </Grid>
  400. </Border>
  401. </Grid>
  402. <StackPanel Visibility="Collapsed" Orientation="Horizontal" Margin="0,20,0,0">
  403. <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
  404. Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
  405. VerticalContentAlignment="Center" Background="Transparent"
  406. Style="{DynamicResource GreyBgRadioBtnStyle}">
  407. <RadioButton.Content>
  408. <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
  409. </RadioButton.Content>
  410. <i:Interaction.Triggers>
  411. <i:EventTrigger EventName="Checked">
  412. <i:InvokeCommandAction Command="{Binding LineModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}" />
  413. </i:EventTrigger>
  414. </i:Interaction.Triggers>
  415. </RadioButton>
  416. <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
  417. Width="105" Height="32" Margin="0,0" Foreground="#616469"
  418. VerticalContentAlignment="Center" Background="Transparent"
  419. Style="{DynamicResource GreyBgRadioBtnStyle}">
  420. <RadioButton.Content>
  421. <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
  422. </RadioButton.Content>
  423. <i:Interaction.Triggers>
  424. <i:EventTrigger EventName="Checked">
  425. <i:InvokeCommandAction Command="{Binding LineModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}" />
  426. </i:EventTrigger>
  427. </i:Interaction.Triggers>
  428. </RadioButton>
  429. </StackPanel>
  430. </StackPanel>
  431. </Grid>
  432. </UserControl>