TextEditProperty.xaml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <UserControl
  2. x:Class="PDF_Office.Views.PropertyPanel.PDFEdit.TextEditProperty"
  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:FormControl="clr-namespace:PDF_Office.CustomControl.Form"
  8. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  9. xmlns:cusColor="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  10. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  11. xmlns:form="clr-namespace:PDF_Office.CustomControl.Form"
  12. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  13. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel"
  14. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  15. xmlns:pdfedit="clr-namespace:PDF_Office.Views.PropertyPanel.PDFEdit"
  16. xmlns:prism="http://prismlibrary.com/"
  17. d:DesignHeight="450"
  18. d:DesignWidth="260"
  19. prism:ViewModelLocator.AutoWireViewModel="True"
  20. Background="{StaticResource color.sys.layout.mg}"
  21. Loaded="UserControl_Loaded"
  22. mc:Ignorable="d">
  23. <UserControl.Resources>
  24. <ResourceDictionary>
  25. <ResourceDictionary.MergedDictionaries>
  26. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
  27. <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
  28. <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml" />
  29. </ResourceDictionary.MergedDictionaries>
  30. <Convert:BoolToVisible x:Key="BoolToVisible" />
  31. <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
  32. <Convert:InvertBoolConvert x:Key="InvertBoolConvert" />
  33. <DataTemplate x:Key="FontStyleData">
  34. <Grid>
  35. <TextBlock Foreground="Black" Text="{Binding mFontStyleName}" />
  36. </Grid>
  37. </DataTemplate>
  38. </ResourceDictionary>
  39. </UserControl.Resources>
  40. <Grid Margin="16,14">
  41. <Grid.RowDefinitions>
  42. <RowDefinition Height="Auto" />
  43. <RowDefinition Height="Auto" />
  44. </Grid.RowDefinitions>
  45. <Grid>
  46. <StackPanel>
  47. <TextBlock
  48. Name="AnnotTypeTitle"
  49. HorizontalAlignment="Left"
  50. FontFamily="Segoe UI"
  51. FontSize="14"
  52. FontWeight="SemiBold"
  53. LineHeight="22">
  54. Freetext
  55. </TextBlock>
  56. <Border
  57. Width="228"
  58. Height="88"
  59. Margin="0,8,0,0"
  60. Background="{StaticResource color.field.bg.def}"
  61. BorderBrush="{StaticResource color.field.border.norm}"
  62. BorderThickness="1"
  63. CornerRadius="2">
  64. <Grid>
  65. <Border
  66. Name="FreeTextBorder"
  67. Padding="5"
  68. HorizontalAlignment="Center"
  69. VerticalAlignment="Center">
  70. <TextBlock
  71. Name="SampleText"
  72. HorizontalAlignment="Center"
  73. VerticalAlignment="Center"
  74. FontFamily="{Binding CurrentFontFamily.ValueStr}"
  75. FontSize="{Binding CurrentFontSize.Value}"
  76. FontStyle="{Binding FontStyleItem}"
  77. FontWeight="{Binding FontWeightItem}"
  78. Foreground="{Binding SelectColor}"
  79. Text="Sample" />
  80. </Border>
  81. <Path
  82. Name="UnderlinePath"
  83. Margin="0,51,0,0"
  84. HorizontalAlignment="Center"
  85. StrokeThickness="2"
  86. Visibility="Collapsed">
  87. <Path.Data>
  88. <LineGeometry StartPoint="0,0" EndPoint="62,0" />
  89. </Path.Data>
  90. </Path>
  91. <Path
  92. Name="StrikeoutPath"
  93. Margin="0,40,0,0"
  94. HorizontalAlignment="Center"
  95. StrokeThickness="2"
  96. Visibility="Collapsed">
  97. <Path.Data>
  98. <LineGeometry StartPoint="0,0" EndPoint="62,0" />
  99. </Path.Data>
  100. </Path>
  101. <Path
  102. Name="SquigglyPath"
  103. Margin="0,51,0,0"
  104. HorizontalAlignment="Center"
  105. StrokeThickness="2"
  106. Visibility="Collapsed" />
  107. </Grid>
  108. </Border>
  109. <Border
  110. Height="32"
  111. Margin="0,8,0,18"
  112. BorderBrush="#E2E3E6"
  113. BorderThickness="0">
  114. <Grid>
  115. <CompositeControl:CustomComboControl
  116. x:Name="FontTitleBox"
  117. Width="188"
  118. Height="32"
  119. HorizontalAlignment="Left"
  120. IsValueContent="True"
  121. IsSelectedEmpty ="{Binding IsSelectedEmpty}"
  122. ItemSource="{Binding PresetFontItems}"
  123. SelectedItems="{Binding CurrentPresetFont, Mode=TwoWay}" />
  124. <Button
  125. Width="32"
  126. Height="32"
  127. HorizontalAlignment="Right" Command="{Binding CustomFontStyleCommand}"
  128. Style="{StaticResource btn.sec}">
  129. <Path
  130. Width="16"
  131. Height="16"
  132. 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"
  133. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  134. </Button>
  135. </Grid>
  136. </Border>
  137. <StackPanel>
  138. <TextBlock
  139. Margin="0,0,0,10"
  140. Style="{StaticResource PropertyHeaderLv2}"
  141. Text="文本" />
  142. <StackPanel>
  143. <CompositeControl:CustomComboControl
  144. x:Name="FontFamilyBox"
  145. Height="32"
  146. IsValueContent="True"
  147. IsSelectedEmpty ="{Binding IsSelectedEmpty}"
  148. ItemSource="{Binding FontFamilyItems}"
  149. SelectedItems="{Binding CurrentFontFamily, Mode=TwoWay}" />
  150. <Grid Margin="0,8">
  151. <CompositeControl:CustomComboControl
  152. x:Name="FontStyleBox"
  153. Width="110"
  154. Height="32"
  155. HorizontalAlignment="Left"
  156. IsValueContent="True"
  157. IsSelectedEmpty ="{Binding IsSelectedEmpty}"
  158. ItemSource="{Binding FontStyleItems}"
  159. SelectedItems="{Binding CurrrentFontWeightStyle, Mode=TwoWay}" />
  160. <CompositeControl:CustomComboControl
  161. x:Name="FontSizeBox"
  162. Width="110"
  163. Height="32"
  164. HorizontalAlignment="Right"
  165. IsSelectedEmpty ="{Binding IsSelectedEmpty}"
  166. SelectedItems="{Binding CurrentFontSize, Mode=TwoWay}" />
  167. </Grid>
  168. <Grid>
  169. <StackPanel Orientation="Horizontal">
  170. <RadioButton
  171. x:Name="TextAlignLeftBtn"
  172. Width="32"
  173. Height="32"
  174. VerticalContentAlignment="Center"
  175. Background="Transparent"
  176. Foreground="#616469"
  177. GroupName="TextAlign"
  178. IsChecked="True"
  179. Style="{DynamicResource GreyBgRadioBtnStyle}"
  180. Tag="AlignLeft">
  181. <RadioButton.Content>
  182. <Grid Width="32" Height="32">
  183. <Canvas Margin="5,10,0,0">
  184. <Rectangle
  185. Canvas.Top="0.25"
  186. Width="14"
  187. Height="1.5"
  188. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  189. StrokeThickness="1.5" />
  190. <Rectangle
  191. Canvas.Top="4.25"
  192. Width="8"
  193. Height="1.5"
  194. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  195. StrokeThickness="1.5" />
  196. <Rectangle
  197. Canvas.Top="12.25"
  198. Width="8"
  199. Height="1.5"
  200. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  201. StrokeThickness="1.5" />
  202. <Rectangle
  203. Canvas.Top="8.25"
  204. Width="14"
  205. Height="1.5"
  206. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  207. StrokeThickness="1.5" />
  208. </Canvas>
  209. </Grid>
  210. </RadioButton.Content>
  211. <i:Interaction.Triggers>
  212. <i:EventTrigger EventName="Checked">
  213. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn, Path=Tag}" />
  214. </i:EventTrigger>
  215. </i:Interaction.Triggers>
  216. </RadioButton>
  217. <RadioButton
  218. x:Name="TextAlignCenterBtn"
  219. Width="32"
  220. Height="32"
  221. Margin="8,0"
  222. VerticalContentAlignment="Center"
  223. Background="Transparent"
  224. Foreground="#616469"
  225. GroupName="TextAlign"
  226. Style="{DynamicResource GreyBgRadioBtnStyle}"
  227. Tag="AlignCenter">
  228. <RadioButton.Content>
  229. <Grid Width="32" Height="32">
  230. <Canvas Margin="5,10,0,0">
  231. <Rectangle
  232. Canvas.Top="0.25"
  233. Width="14"
  234. Height="1.5"
  235. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  236. StrokeThickness="1.5" />
  237. <Rectangle
  238. Canvas.Left="3"
  239. Canvas.Top="4.25"
  240. Width="8"
  241. Height="1.5"
  242. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  243. StrokeThickness="1.5" />
  244. <Rectangle
  245. Canvas.Left="3"
  246. Canvas.Top="12.25"
  247. Width="8"
  248. Height="1.5"
  249. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  250. StrokeThickness="1.5" />
  251. <Rectangle
  252. Canvas.Top="8.25"
  253. Width="14"
  254. Height="1.5"
  255. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  256. StrokeThickness="1.5" />
  257. </Canvas>
  258. </Grid>
  259. </RadioButton.Content>
  260. <i:Interaction.Triggers>
  261. <i:EventTrigger EventName="Checked">
  262. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn, Path=Tag}" />
  263. </i:EventTrigger>
  264. </i:Interaction.Triggers>
  265. </RadioButton>
  266. <RadioButton
  267. x:Name="TextAlignRightBtn"
  268. Grid.Column="2"
  269. Width="32"
  270. Height="32"
  271. VerticalContentAlignment="Center"
  272. Background="Transparent"
  273. Foreground="#616469"
  274. GroupName="TextAlign"
  275. Style="{DynamicResource GreyBgRadioBtnStyle}"
  276. Tag="AlignRight">
  277. <RadioButton.Content>
  278. <Grid Width="32" Height="32">
  279. <Canvas Margin="5,10,0,0">
  280. <Rectangle
  281. Canvas.Top="0.25"
  282. Width="14"
  283. Height="1.5"
  284. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  285. StrokeThickness="1.5" />
  286. <Rectangle
  287. Canvas.Left="6"
  288. Canvas.Top="4.25"
  289. Width="8"
  290. Height="1.5"
  291. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  292. StrokeThickness="1.5" />
  293. <Rectangle
  294. Canvas.Left="6"
  295. Canvas.Top="12.25"
  296. Width="8"
  297. Height="1.5"
  298. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  299. StrokeThickness="1.5" />
  300. <Rectangle
  301. Canvas.Top="8.25"
  302. Width="14"
  303. Height="1.5"
  304. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  305. StrokeThickness="1.5" />
  306. </Canvas>
  307. </Grid>
  308. </RadioButton.Content>
  309. <i:Interaction.Triggers>
  310. <i:EventTrigger EventName="Checked">
  311. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn, Path=Tag}" />
  312. </i:EventTrigger>
  313. </i:Interaction.Triggers>
  314. </RadioButton>
  315. <RadioButton
  316. x:Name="TextAlignBtn"
  317. Grid.Column="3"
  318. Width="32"
  319. Height="32"
  320. Margin="8,0"
  321. VerticalContentAlignment="Center"
  322. Background="Transparent"
  323. Foreground="#616469"
  324. GroupName="TextAlign"
  325. Style="{DynamicResource GreyBgRadioBtnStyle}"
  326. Tag="Align">
  327. <RadioButton.Content>
  328. <Grid Width="32" Height="32">
  329. <Canvas Margin="5,10,0,0">
  330. <Rectangle
  331. Canvas.Top="0.25"
  332. Width="14"
  333. Height="1.5"
  334. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  335. StrokeThickness="1.5" />
  336. <Rectangle
  337. Canvas.Top="8.25"
  338. Width="14"
  339. Height="1.5"
  340. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  341. StrokeThickness="1.5" />
  342. <Rectangle
  343. Canvas.Top="4.25"
  344. Width="14"
  345. Height="1.5"
  346. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  347. StrokeThickness="1.5" />
  348. <Rectangle
  349. Canvas.Top="12.25"
  350. Width="14"
  351. Height="1.5"
  352. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  353. StrokeThickness="1.5" />
  354. </Canvas>
  355. </Grid>
  356. </RadioButton.Content>
  357. <i:Interaction.Triggers>
  358. <i:EventTrigger EventName="Checked">
  359. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn, Path=Tag}" />
  360. </i:EventTrigger>
  361. </i:Interaction.Triggers>
  362. </RadioButton>
  363. </StackPanel>
  364. <cusColor:ColorContent
  365. x:Name="FontColorBox"
  366. Width="56"
  367. HorizontalAlignment="Right" SelectedColor="{Binding CurrentColor}"
  368. ShowColorList="Collapsed" >
  369. <i:Interaction.Triggers>
  370. <i:EventTrigger EventName="SelectedColorInvoke">
  371. <i:InvokeCommandAction Command="{Binding SelectedColorCommand}" CommandParameter="{Binding ElementName=FontColorBox, Path=SelectedColor}" />
  372. </i:EventTrigger>
  373. </i:Interaction.Triggers>
  374. </cusColor:ColorContent>
  375. </Grid>
  376. </StackPanel>
  377. </StackPanel>
  378. <TextBlock
  379. x:Name="AlignImg"
  380. Margin="0,18,0,10"
  381. FontFamily="Segoe UI"
  382. FontSize="12"
  383. FontWeight="SemiBold"
  384. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  385. LineHeight="20">
  386. Align
  387. </TextBlock>
  388. </StackPanel>
  389. </Grid>
  390. <FormControl:LayoutAglinContent
  391. x:Name="laoutAglin"
  392. Grid.Row="1"
  393. IsLayoutAlign="{Binding IsLayoutAlign}"
  394. IsLayoutAvgAlign="{Binding IsLayoutAvgAlign}">
  395. <i:Interaction.Triggers>
  396. <i:EventTrigger EventName="ValueChanged">
  397. <i:InvokeCommandAction Command="{Binding LayoutAlignCheckedCommand}" CommandParameter="{Binding ElementName=laoutAglin, Path=Btntag}" />
  398. </i:EventTrigger>
  399. </i:Interaction.Triggers>
  400. </FormControl:LayoutAglinContent>
  401. </Grid>
  402. </UserControl>