TextEditProperty.xaml 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  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:cus="clr-namespace:PDF_Office.CustomControl"
  8. xmlns:cusColor="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  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"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:pdfedit="clr-namespace:PDF_Office.Views.PropertyPanel.PDFEdit"
  14. xmlns:prism="http://prismlibrary.com/"
  15. d:DataContext="{d:DesignInstance Type=pdfedit:TextEditPropertyViewModel}"
  16. d:DesignHeight="450"
  17. d:DesignWidth="800"
  18. prism:ViewModelLocator.AutoWireViewModel="True"
  19. Loaded="UserControl_Loaded"
  20. mc:Ignorable="d">
  21. <UserControl.Resources>
  22. <ResourceDictionary>
  23. <ResourceDictionary.MergedDictionaries>
  24. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
  25. <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
  26. <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml" />
  27. </ResourceDictionary.MergedDictionaries>
  28. <Convert:BoolToVisible x:Key="BoolToVisible" />
  29. <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
  30. <Convert:InvertBoolConvert x:Key="InvertBoolConvert" />
  31. <ContextMenu x:Key="BtnFlyoutMenu" FontSize="14">
  32. <ContextMenu.ItemContainerStyle>
  33. <Style TargetType="MenuItem">
  34. <Setter Property="Padding" Value="0,7,0,7" />
  35. <Setter Property="VerticalContentAlignment" Value="Center" />
  36. </Style>
  37. </ContextMenu.ItemContainerStyle>
  38. <MenuItem
  39. Name="ChangeStyleMenuItem"
  40. Header="用所选部分重新定义"
  41. IsEnabled="True" />
  42. <MenuItem
  43. Name="BackStyleMenuItem"
  44. Header="恢复默认预设样式"
  45. IsEnabled="True" />
  46. </ContextMenu>
  47. <DataTemplate x:Key="FontStyleData">
  48. <Grid>
  49. <TextBlock Foreground="Black" Text="{Binding mFontStyleName}" />
  50. </Grid>
  51. </DataTemplate>
  52. </ResourceDictionary>
  53. </UserControl.Resources>
  54. <Grid Background="#F3F3F3">
  55. <Grid.RowDefinitions>
  56. <RowDefinition Height="Auto" />
  57. <RowDefinition Height="Auto" />
  58. </Grid.RowDefinitions>
  59. <Grid Visibility="{Binding IsSelectTextAndImg, Converter={StaticResource InvertBoolToVisibleConvert}}">
  60. <StackPanel Visibility="{Binding IsTextEdit, Converter={StaticResource BoolToVisible}}">
  61. <TextBlock
  62. Name="AnnotTypeTitle"
  63. Margin="10,8,0,0"
  64. HorizontalAlignment="Left"
  65. FontFamily="Segoe UI Semibold"
  66. FontSize="18"
  67. FontWeight="SemiBold"
  68. LineHeight="24">
  69. Freetext
  70. </TextBlock>
  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. <Grid>
  80. <Border
  81. Name="FreeTextBorder"
  82. Padding="5"
  83. HorizontalAlignment="Center"
  84. VerticalAlignment="Center">
  85. <TextBlock
  86. Name="SampleText"
  87. HorizontalAlignment="Center"
  88. VerticalAlignment="Center"
  89. FontFamily="{Binding TextFontFamily}"
  90. FontSize="{Binding TextFontSize}"
  91. FontStyle="{Binding TextFontStyle}"
  92. FontWeight="{Binding TextFontWeights}"
  93. Foreground="{Binding SelectColor}"
  94. Text="Sample" />
  95. </Border>
  96. <Path
  97. Name="UnderlinePath"
  98. Margin="0,51,0,0"
  99. HorizontalAlignment="Center"
  100. StrokeThickness="2"
  101. Visibility="Collapsed">
  102. <Path.Data>
  103. <LineGeometry StartPoint="0,0" EndPoint="62,0" />
  104. </Path.Data>
  105. </Path>
  106. <Path
  107. Name="StrikeoutPath"
  108. Margin="0,40,0,0"
  109. HorizontalAlignment="Center"
  110. StrokeThickness="2"
  111. Visibility="Collapsed">
  112. <Path.Data>
  113. <LineGeometry StartPoint="0,0" EndPoint="62,0" />
  114. </Path.Data>
  115. </Path>
  116. <Path
  117. Name="SquigglyPath"
  118. Margin="0,51,0,0"
  119. HorizontalAlignment="Center"
  120. StrokeThickness="2"
  121. Visibility="Collapsed" />
  122. </Grid>
  123. </Border>
  124. <Border
  125. Height="32"
  126. Margin="12,0,4,0"
  127. BorderBrush="#E2E3E6"
  128. BorderThickness="0">
  129. <StackPanel Orientation="Horizontal">
  130. <ComboBox
  131. Name="FontTitleBox"
  132. Width="148"
  133. Padding="10,10,0,0"
  134. Background="Transparent"
  135. BorderBrush="#FFE2E3E6"
  136. BorderThickness="1"
  137. IsReadOnly="True"
  138. ItemTemplate="{StaticResource FontStyleData}"
  139. ItemsSource="{Binding FontStyleList}">
  140. <i:Interaction.Triggers>
  141. <i:EventTrigger EventName="SelectionChanged">
  142. <i:InvokeCommandAction Command="{Binding SelectedFontStyleCommand}" CommandParameter="{Binding ElementName=FontTitleBox, Path=SelectedItem}" />
  143. </i:EventTrigger>
  144. </i:Interaction.Triggers>
  145. </ComboBox>
  146. <Button
  147. Width="32"
  148. Height="32"
  149. ContextMenu="{StaticResource BtnFlyoutMenu}" />
  150. </StackPanel>
  151. </Border>
  152. <TextBlock
  153. x:Name="FontText"
  154. Margin="12,18,0,0"
  155. FontFamily="Segoe UI Semibold"
  156. FontSize="14"
  157. FontWeight="SemiBold"
  158. LineHeight="20">
  159. Font
  160. </TextBlock>
  161. <Grid Margin="0,6,0,0">
  162. <Grid.ColumnDefinitions>
  163. <ColumnDefinition Width="auto" />
  164. <ColumnDefinition Width="auto" />
  165. </Grid.ColumnDefinitions>
  166. <Grid.RowDefinitions>
  167. <RowDefinition Height="auto" />
  168. <RowDefinition Height="auto" />
  169. <RowDefinition Height="auto" />
  170. </Grid.RowDefinitions>
  171. <Border
  172. Grid.ColumnSpan="2"
  173. Width="228"
  174. Height="32"
  175. Margin="12,0,4,0"
  176. BorderBrush="#E2E3E6"
  177. BorderThickness="0">
  178. <Grid>
  179. <ComboBox
  180. Name="FontFamilyBox"
  181. Padding="10,10,0,0"
  182. Background="Transparent"
  183. BorderBrush="#FFE2E3E6"
  184. BorderThickness="1"
  185. IsReadOnly="True">
  186. <ComboBox.ItemContainerStyle>
  187. <Style TargetType="{x:Type ComboBoxItem}">
  188. <Setter Property="Padding" Value="10,0,0,0" />
  189. </Style>
  190. </ComboBox.ItemContainerStyle>
  191. <ComboBoxItem
  192. Height="32"
  193. VerticalContentAlignment="Center"
  194. Template="{StaticResource comboxitem}">
  195. <TextBlock
  196. FontFamily="Courier New"
  197. FontSize="14"
  198. Tag="Courier"
  199. Text="Courier New" />
  200. </ComboBoxItem>
  201. <ComboBoxItem
  202. Height="32"
  203. VerticalContentAlignment="Center"
  204. Template="{StaticResource comboxitem}">
  205. <TextBlock
  206. FontFamily="Arial"
  207. FontSize="14"
  208. Tag="Helvetica"
  209. Text="Arial" />
  210. </ComboBoxItem>
  211. <ComboBoxItem
  212. Height="32"
  213. VerticalContentAlignment="Center"
  214. Template="{StaticResource comboxitem}">
  215. <TextBlock
  216. FontFamily="Times New Roman"
  217. FontSize="14"
  218. Tag="Times Roman"
  219. Text="Times New Roman" />
  220. </ComboBoxItem>
  221. <i:Interaction.Triggers>
  222. <i:EventTrigger EventName="SelectionChanged">
  223. <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" CommandParameter="{Binding ElementName=FontFamilyBox, Path=SelectedIndex}" />
  224. </i:EventTrigger>
  225. </i:Interaction.Triggers>
  226. </ComboBox>
  227. <TextBox
  228. Name="FontFamilyText"
  229. Margin="2,0,25,0"
  230. Padding="10,0,0,0"
  231. VerticalAlignment="Center"
  232. Background="White"
  233. BorderThickness="0"
  234. FontFamily="Segoe UI"
  235. FontSize="14"
  236. IsReadOnly="True"
  237. TextAlignment="Left" />
  238. </Grid>
  239. </Border>
  240. <cusColor:ColorSubContent
  241. x:Name="FontColorBox"
  242. Grid.Row="2"
  243. Grid.Column="1"
  244. HorizontalAlignment="Left" />
  245. <Border
  246. Grid.Row="1"
  247. Width="148"
  248. Height="32"
  249. Margin="12,8,4,0"
  250. BorderBrush="#E2E3E6"
  251. BorderThickness="0">
  252. <Grid>
  253. <ComboBox
  254. Name="FontStyleBox"
  255. Padding="10,10,0,0"
  256. Background="Transparent"
  257. BorderBrush="#FFE2E3E6"
  258. BorderThickness="1"
  259. IsReadOnly="True">
  260. <ComboBox.ItemContainerStyle>
  261. <Style TargetType="{x:Type ComboBoxItem}">
  262. <Setter Property="Padding" Value="10,0,0,0" />
  263. </Style>
  264. </ComboBox.ItemContainerStyle>
  265. <ComboBoxItem
  266. x:Name="RegularItem"
  267. Height="32"
  268. VerticalContentAlignment="Center"
  269. Template="{StaticResource comboxitem}">
  270. Regular
  271. </ComboBoxItem>
  272. <ComboBoxItem
  273. x:Name="BoldItem"
  274. Height="32"
  275. VerticalContentAlignment="Center"
  276. Template="{StaticResource comboxitem}">
  277. Bold
  278. </ComboBoxItem>
  279. <ComboBoxItem
  280. x:Name="ItalicItem"
  281. Height="32"
  282. VerticalContentAlignment="Center"
  283. Template="{StaticResource comboxitem}">
  284. Italic
  285. </ComboBoxItem>
  286. <ComboBoxItem
  287. x:Name="BoldItalicItem"
  288. Height="32"
  289. VerticalContentAlignment="Center"
  290. Template="{StaticResource comboxitem}">
  291. Bold Italic
  292. </ComboBoxItem>
  293. <i:Interaction.Triggers>
  294. <i:EventTrigger EventName="SelectionChanged">
  295. <i:InvokeCommandAction Command="{Binding FontStyleChangedCommand}" CommandParameter="{Binding ElementName=FontStyleBox, Path=SelectedItem}" />
  296. </i:EventTrigger>
  297. </i:Interaction.Triggers>
  298. </ComboBox>
  299. <TextBox
  300. Name="FontStyleText"
  301. Height="20"
  302. Margin="2,0,35,0"
  303. Padding="10,0,0,0"
  304. VerticalAlignment="Center"
  305. Background="White"
  306. BorderThickness="0"
  307. FontFamily="Segoe UI"
  308. FontSize="14"
  309. IsReadOnly="True"
  310. TextAlignment="Left" />
  311. </Grid>
  312. </Border>
  313. <Border
  314. Grid.Row="1"
  315. Grid.Column="1"
  316. Width="80"
  317. Height="32"
  318. Margin="-1,8,0,0"
  319. BorderBrush="#E2E3E6"
  320. BorderThickness="0">
  321. <Grid>
  322. <ComboBox
  323. Name="FontSizeBox"
  324. Background="Transparent"
  325. BorderBrush="#FFE2E3E6"
  326. BorderThickness="1"
  327. MaxDropDownHeight="200">
  328. <ComboBox.ItemContainerStyle>
  329. <Style TargetType="{x:Type ComboBoxItem}">
  330. <Setter Property="Padding" Value="10,0,0,0" />
  331. </Style>
  332. </ComboBox.ItemContainerStyle>
  333. <ComboBoxItem
  334. Height="32"
  335. VerticalContentAlignment="Center"
  336. Template="{StaticResource comboxitem}">
  337. 6
  338. </ComboBoxItem>
  339. <ComboBoxItem
  340. Height="32"
  341. VerticalContentAlignment="Center"
  342. Template="{StaticResource comboxitem}">
  343. 8
  344. </ComboBoxItem>
  345. <ComboBoxItem
  346. Height="32"
  347. VerticalContentAlignment="Center"
  348. Template="{StaticResource comboxitem}">
  349. 9
  350. </ComboBoxItem>
  351. <ComboBoxItem
  352. Height="32"
  353. VerticalContentAlignment="Center"
  354. Template="{StaticResource comboxitem}">
  355. 10
  356. </ComboBoxItem>
  357. <ComboBoxItem
  358. Height="32"
  359. VerticalContentAlignment="Center"
  360. Template="{StaticResource comboxitem}">
  361. 12
  362. </ComboBoxItem>
  363. <ComboBoxItem
  364. Height="32"
  365. VerticalContentAlignment="Center"
  366. Template="{StaticResource comboxitem}">
  367. 14
  368. </ComboBoxItem>
  369. <ComboBoxItem
  370. Height="32"
  371. VerticalContentAlignment="Center"
  372. Template="{StaticResource comboxitem}">
  373. 18
  374. </ComboBoxItem>
  375. <ComboBoxItem
  376. Height="32"
  377. VerticalContentAlignment="Center"
  378. Template="{StaticResource comboxitem}">
  379. 20
  380. </ComboBoxItem>
  381. <ComboBoxItem
  382. Height="32"
  383. VerticalContentAlignment="Center"
  384. Template="{StaticResource comboxitem}">
  385. 22
  386. </ComboBoxItem>
  387. <ComboBoxItem
  388. Height="32"
  389. VerticalContentAlignment="Center"
  390. Template="{StaticResource comboxitem}">
  391. 24
  392. </ComboBoxItem>
  393. <ComboBoxItem
  394. Height="32"
  395. VerticalContentAlignment="Center"
  396. Template="{StaticResource comboxitem}">
  397. 26
  398. </ComboBoxItem>
  399. <ComboBoxItem
  400. Height="32"
  401. VerticalContentAlignment="Center"
  402. Template="{StaticResource comboxitem}">
  403. 28
  404. </ComboBoxItem>
  405. <ComboBoxItem
  406. Height="32"
  407. VerticalContentAlignment="Center"
  408. Template="{StaticResource comboxitem}">
  409. 32
  410. </ComboBoxItem>
  411. <ComboBoxItem
  412. Height="32"
  413. VerticalContentAlignment="Center"
  414. Template="{StaticResource comboxitem}">
  415. 36
  416. </ComboBoxItem>
  417. <ComboBoxItem
  418. Height="32"
  419. VerticalContentAlignment="Center"
  420. Template="{StaticResource comboxitem}">
  421. 48
  422. </ComboBoxItem>
  423. <ComboBoxItem
  424. Height="32"
  425. VerticalContentAlignment="Center"
  426. Template="{StaticResource comboxitem}">
  427. 72
  428. </ComboBoxItem>
  429. <i:Interaction.Triggers>
  430. <i:EventTrigger EventName="SelectionChanged">
  431. <i:InvokeCommandAction Command="{Binding FontSizeChangedCommand}" CommandParameter="{Binding ElementName=FontSizeBox, Path=SelectedItem}" />
  432. </i:EventTrigger>
  433. </i:Interaction.Triggers>
  434. </ComboBox>
  435. <TextBox
  436. Name="FontSizeText"
  437. Height="20"
  438. Margin="2,0,35,0"
  439. Padding="10,0,0,0"
  440. VerticalAlignment="Center"
  441. Background="White"
  442. BorderThickness="0"
  443. FontFamily="Segoe UI"
  444. FontSize="14"
  445. IsReadOnly="True"
  446. TextAlignment="Left" />
  447. </Grid>
  448. </Border>
  449. <Border
  450. Grid.Row="2"
  451. Grid.ColumnSpan="2"
  452. Width="148"
  453. Margin="12,8,0,0"
  454. HorizontalAlignment="Left">
  455. <Grid Name="ToolGrid">
  456. <Grid.ColumnDefinitions>
  457. <ColumnDefinition Width="*" />
  458. <ColumnDefinition Width="*" />
  459. <ColumnDefinition Width="*" />
  460. <ColumnDefinition Width="*" />
  461. </Grid.ColumnDefinitions>
  462. <RadioButton
  463. x:Name="TextAlignLeftBtn"
  464. Width="32"
  465. Height="32"
  466. VerticalContentAlignment="Center"
  467. Background="Transparent"
  468. Foreground="#616469"
  469. GroupName="TextAlign"
  470. IsChecked="True"
  471. Style="{DynamicResource GreyBgRadioBtnStyle}"
  472. Tag="AlignLeft">
  473. <RadioButton.Content>
  474. <Grid Width="32" Height="32">
  475. <Canvas Margin="5,10,0,0">
  476. <Rectangle
  477. Canvas.Top="0.25"
  478. Width="14"
  479. Height="1.5"
  480. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  481. StrokeThickness="1.5" />
  482. <Rectangle
  483. Canvas.Top="4.25"
  484. Width="8"
  485. Height="1.5"
  486. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  487. StrokeThickness="1.5" />
  488. <Rectangle
  489. Canvas.Top="12.25"
  490. Width="8"
  491. Height="1.5"
  492. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  493. StrokeThickness="1.5" />
  494. <Rectangle
  495. Canvas.Top="8.25"
  496. Width="14"
  497. Height="1.5"
  498. Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
  499. StrokeThickness="1.5" />
  500. </Canvas>
  501. </Grid>
  502. </RadioButton.Content>
  503. <i:Interaction.Triggers>
  504. <i:EventTrigger EventName="Checked">
  505. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn, Path=Tag}" />
  506. </i:EventTrigger>
  507. </i:Interaction.Triggers>
  508. </RadioButton>
  509. <RadioButton
  510. x:Name="TextAlignCenterBtn"
  511. Grid.Column="1"
  512. Width="32"
  513. Height="32"
  514. VerticalContentAlignment="Center"
  515. Background="Transparent"
  516. Foreground="#616469"
  517. GroupName="TextAlign"
  518. Style="{DynamicResource GreyBgRadioBtnStyle}"
  519. Tag="AlignCenter">
  520. <RadioButton.Content>
  521. <Grid Width="32" Height="32">
  522. <Canvas Margin="5,10,0,0">
  523. <Rectangle
  524. Canvas.Top="0.25"
  525. Width="14"
  526. Height="1.5"
  527. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  528. StrokeThickness="1.5" />
  529. <Rectangle
  530. Canvas.Left="3"
  531. Canvas.Top="4.25"
  532. Width="8"
  533. Height="1.5"
  534. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  535. StrokeThickness="1.5" />
  536. <Rectangle
  537. Canvas.Left="3"
  538. Canvas.Top="12.25"
  539. Width="8"
  540. Height="1.5"
  541. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  542. StrokeThickness="1.5" />
  543. <Rectangle
  544. Canvas.Top="8.25"
  545. Width="14"
  546. Height="1.5"
  547. Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
  548. StrokeThickness="1.5" />
  549. </Canvas>
  550. </Grid>
  551. </RadioButton.Content>
  552. <i:Interaction.Triggers>
  553. <i:EventTrigger EventName="Checked">
  554. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn, Path=Tag}" />
  555. </i:EventTrigger>
  556. </i:Interaction.Triggers>
  557. </RadioButton>
  558. <RadioButton
  559. x:Name="TextAlignRightBtn"
  560. Grid.Column="2"
  561. Width="32"
  562. Height="32"
  563. VerticalContentAlignment="Center"
  564. Background="Transparent"
  565. Foreground="#616469"
  566. GroupName="TextAlign"
  567. Style="{DynamicResource GreyBgRadioBtnStyle}"
  568. Tag="AlignRight">
  569. <RadioButton.Content>
  570. <Grid Width="32" Height="32">
  571. <Canvas Margin="5,10,0,0">
  572. <Rectangle
  573. Canvas.Top="0.25"
  574. Width="14"
  575. Height="1.5"
  576. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  577. StrokeThickness="1.5" />
  578. <Rectangle
  579. Canvas.Left="6"
  580. Canvas.Top="4.25"
  581. Width="8"
  582. Height="1.5"
  583. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  584. StrokeThickness="1.5" />
  585. <Rectangle
  586. Canvas.Left="6"
  587. Canvas.Top="12.25"
  588. Width="8"
  589. Height="1.5"
  590. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  591. StrokeThickness="1.5" />
  592. <Rectangle
  593. Canvas.Top="8.25"
  594. Width="14"
  595. Height="1.5"
  596. Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
  597. StrokeThickness="1.5" />
  598. </Canvas>
  599. </Grid>
  600. </RadioButton.Content>
  601. <i:Interaction.Triggers>
  602. <i:EventTrigger EventName="Checked">
  603. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn, Path=Tag}" />
  604. </i:EventTrigger>
  605. </i:Interaction.Triggers>
  606. </RadioButton>
  607. <RadioButton
  608. x:Name="TextAlignBtn"
  609. Grid.Column="3"
  610. Width="32"
  611. Height="32"
  612. VerticalContentAlignment="Center"
  613. Background="Transparent"
  614. Foreground="#616469"
  615. GroupName="TextAlign"
  616. Style="{DynamicResource GreyBgRadioBtnStyle}"
  617. Tag="Align">
  618. <RadioButton.Content>
  619. <Grid Width="32" Height="32">
  620. <Canvas Margin="5,10,0,0">
  621. <Rectangle
  622. Canvas.Top="0.25"
  623. Width="14"
  624. Height="1.5"
  625. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  626. StrokeThickness="1.5" />
  627. <Rectangle
  628. Canvas.Top="8.25"
  629. Width="14"
  630. Height="1.5"
  631. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  632. StrokeThickness="1.5" />
  633. <Rectangle
  634. Canvas.Top="4.25"
  635. Width="14"
  636. Height="1.5"
  637. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  638. StrokeThickness="1.5" />
  639. <Rectangle
  640. Canvas.Top="12.25"
  641. Width="14"
  642. Height="1.5"
  643. Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
  644. StrokeThickness="1.5" />
  645. </Canvas>
  646. </Grid>
  647. </RadioButton.Content>
  648. <i:Interaction.Triggers>
  649. <i:EventTrigger EventName="Checked">
  650. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn, Path=Tag}" />
  651. </i:EventTrigger>
  652. </i:Interaction.Triggers>
  653. </RadioButton>
  654. </Grid>
  655. </Border>
  656. </Grid>
  657. <TextBlock
  658. x:Name="AlignText"
  659. Margin="12,14,0,0"
  660. FontFamily="Segoe UI Semibold"
  661. FontSize="14"
  662. FontWeight="SemiBold"
  663. LineHeight="20">
  664. Align
  665. </TextBlock>
  666. </StackPanel>
  667. <StackPanel Visibility="{Binding IsTextEdit, Converter={StaticResource InvertBoolToVisibleConvert}}">
  668. <TextBlock
  669. Name="AnnotTypeTitle1"
  670. Margin="10,8,0,0"
  671. HorizontalAlignment="Left"
  672. FontFamily="Segoe UI Semibold"
  673. FontSize="18"
  674. FontWeight="SemiBold"
  675. LineHeight="24">
  676. Image
  677. </TextBlock>
  678. <Border
  679. Width="228"
  680. Height="100"
  681. Margin="0,8,0,0"
  682. Background="White"
  683. BorderBrush="#DDDDDD"
  684. BorderThickness="1"
  685. CornerRadius="2">
  686. <Grid>
  687. <Border
  688. Name="FreeTextBorder1"
  689. Padding="5"
  690. HorizontalAlignment="Center"
  691. VerticalAlignment="Center">
  692. <Image x:Name="ImgExmple" Source="{Binding CurrentImg}">
  693. <Image.RenderTransform>
  694. <RotateTransform x:Name="test" Angle="{Binding Angle}" />
  695. </Image.RenderTransform>
  696. </Image>
  697. </Border>
  698. </Grid>
  699. </Border>
  700. <StackPanel
  701. Margin="0,18,0,0"
  702. HorizontalAlignment="Center"
  703. Orientation="Horizontal">
  704. <Button
  705. Width="32"
  706. Height="32"
  707. Margin="0,0,20,0"
  708. Command="{Binding AntiClockwiseCommand}"
  709. Content="逆转"
  710. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}" />
  711. <Button
  712. Width="32"
  713. Height="32"
  714. Command="{Binding ClockwiseCommand}"
  715. Content="顺转"
  716. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}" />
  717. </StackPanel>
  718. <CompositeControl:SlidComboControl IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}" />
  719. <StackPanel
  720. Width="228"
  721. Margin="0,20,0,0"
  722. HorizontalAlignment="Center">
  723. <Grid x:Name="GridCrop">
  724. <cus:CustomIconToggleBtn
  725. x:Name="BtnCrop"
  726. BorderBrush="#DFE1E5"
  727. BorderThickness="1"
  728. Command="{Binding CropModeCommand}"
  729. ContentStringFormat="156"
  730. Foreground="Black"
  731. Style="{StaticResource ToggleBtnViewModeStyle}"
  732. Tag="Crop"
  733. Visibility="{Binding IsCrop, Converter={StaticResource InvertBoolToVisibleConvert}}">
  734. <TextBlock Text="Crop" />
  735. </cus:CustomIconToggleBtn>
  736. <Grid Visibility="{Binding IsCrop, Converter={StaticResource BoolToVisible}}">
  737. <Grid.ColumnDefinitions>
  738. <ColumnDefinition Width="*" />
  739. <ColumnDefinition Width="8" />
  740. <ColumnDefinition Width="*" />
  741. </Grid.ColumnDefinitions>
  742. <Button
  743. Height="32"
  744. Background="#1770F4"
  745. Command="{Binding CropImgCommand}"
  746. Content="Confirm" />
  747. <Button
  748. Grid.Column="2"
  749. Background="White"
  750. BorderBrush="#DFE1E5"
  751. BorderThickness="1"
  752. Command="{Binding CancelCropCommand}"
  753. Content="Cancel" />
  754. </Grid>
  755. </Grid>
  756. <cus:CustomIconToggleBtn
  757. x:Name="BtnReplace"
  758. Margin="0,13,0,0"
  759. BorderBrush="#DFE1E5"
  760. BorderThickness="1"
  761. Command="{Binding ReplaceImgCommand}"
  762. ContentStringFormat="156"
  763. Foreground="Black"
  764. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  765. Style="{StaticResource ToggleBtnViewModeStyle}"
  766. Tag="Replace">
  767. <TextBlock Text="Replace" />
  768. </cus:CustomIconToggleBtn>
  769. <cus:CustomIconToggleBtn
  770. x:Name="BtnExtract"
  771. Margin="0,13,0,0"
  772. BorderBrush="#DFE1E5"
  773. BorderThickness="1"
  774. Command="{Binding ExportImgCommand}"
  775. ContentStringFormat="156"
  776. Foreground="Black"
  777. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  778. Style="{StaticResource ToggleBtnViewModeStyle}"
  779. Tag="Extract">
  780. <TextBlock Text="Extract" />
  781. </cus:CustomIconToggleBtn>
  782. </StackPanel>
  783. <TextBlock
  784. x:Name="AlignImg"
  785. Margin="12,14,0,0"
  786. FontFamily="Segoe UI Semibold"
  787. FontSize="14"
  788. FontWeight="SemiBold"
  789. LineHeight="20">
  790. Align
  791. </TextBlock>
  792. </StackPanel>
  793. </Grid>
  794. <StackPanel Visibility="{Binding IsSelectTextAndImg, Converter={StaticResource BoolToVisible}}">
  795. <TextBlock
  796. x:Name="GeneralProperties"
  797. Margin="12,14,0,0"
  798. FontFamily="Segoe UI Semibold"
  799. FontSize="14"
  800. FontWeight="SemiBold"
  801. LineHeight="20">
  802. General Properties
  803. </TextBlock>
  804. <TextBlock
  805. x:Name="AlignTextAndImg"
  806. Margin="12,14,0,0"
  807. FontFamily="Segoe UI Semibold"
  808. FontSize="14"
  809. FontWeight="SemiBold"
  810. LineHeight="20">
  811. Align
  812. </TextBlock>
  813. </StackPanel>
  814. <Grid
  815. x:Name="LayoutAlignGrid"
  816. Grid.Row="1"
  817. Width="150"
  818. Margin="0,10,0,0"
  819. HorizontalAlignment="Left">
  820. <Grid.RowDefinitions>
  821. <RowDefinition Height="*" />
  822. <RowDefinition Height="*" />
  823. </Grid.RowDefinitions>
  824. <Grid.ColumnDefinitions>
  825. <ColumnDefinition Width="*" />
  826. <ColumnDefinition Width="*" />
  827. <ColumnDefinition Width="*" />
  828. <ColumnDefinition Width="*" />
  829. </Grid.ColumnDefinitions>
  830. <RadioButton
  831. x:Name="BtnImgLayoutAlignLeft"
  832. Grid.Row="0"
  833. Grid.Column="0"
  834. Width="32"
  835. Height="32"
  836. VerticalContentAlignment="Center"
  837. Background="Transparent"
  838. Foreground="#616469"
  839. GroupName="ImgAlign"
  840. IsEnabled="{Binding IsLayoutAlign}"
  841. Style="{DynamicResource GreyBgRadioBtnStyle}"
  842. Tag="AlignLeft">
  843. <RadioButton.Content>
  844. <Path
  845. Margin="5,0,0,0"
  846. Data="M2.01367 15V1H3.51367V15H2.01367ZM5 4H11V7H5V4ZM14 9H5V12H14V9Z"
  847. Fill="{Binding ElementName=BtnImgLayoutAlignLeft, Path=Foreground}" />
  848. </RadioButton.Content>
  849. <i:Interaction.Triggers>
  850. <i:EventTrigger EventName="Checked">
  851. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignLeft, Path=Tag}" />
  852. </i:EventTrigger>
  853. </i:Interaction.Triggers>
  854. </RadioButton>
  855. <RadioButton
  856. x:Name="BtnImgLayoutAlignHorizonCenter"
  857. Grid.Row="0"
  858. Grid.Column="1"
  859. Width="32"
  860. Height="32"
  861. VerticalContentAlignment="Center"
  862. Background="Transparent"
  863. Foreground="#616469"
  864. GroupName="ImgAlign"
  865. IsEnabled="{Binding IsLayoutAlign}"
  866. Style="{DynamicResource GreyBgRadioBtnStyle}"
  867. Tag="AlignHorizonCenter">
  868. <RadioButton.Content>
  869. <Path
  870. Margin="5,0,0,0"
  871. Data="M8.75 7L8.75 9L12 9L12 12L8.75 12L8.75 15L7.25 15L7.25 12L4 12L4 9L7.25 9L7.25 7L2 7L2 4L7.25 4L7.25 0.999999L8.75 1L8.75 4L14 4L14 7L8.75 7Z"
  872. Fill="{Binding ElementName=BtnImgLayoutAlignHorizonCenter, Path=Foreground}" />
  873. </RadioButton.Content>
  874. <i:Interaction.Triggers>
  875. <i:EventTrigger EventName="Checked">
  876. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignHorizonCenter, Path=Tag}" />
  877. </i:EventTrigger>
  878. </i:Interaction.Triggers>
  879. </RadioButton>
  880. <RadioButton
  881. x:Name="BtnImgLayoutAlignRight"
  882. Grid.Row="0"
  883. Grid.Column="2"
  884. Width="32"
  885. Height="32"
  886. VerticalContentAlignment="Center"
  887. Background="Transparent"
  888. Foreground="#616469"
  889. GroupName="ImgAlign"
  890. IsEnabled="{Binding IsLayoutAlign}"
  891. Style="{DynamicResource GreyBgRadioBtnStyle}"
  892. Tag="AlignRight">
  893. <RadioButton.Content>
  894. <Path
  895. Margin="5,0,0,0"
  896. Data="M14 1L14 15L12.5 15L12.5 1L14 1ZM11 12L2 12L2 9L11 9L11 12ZM4 7L11 7L11 4L4 4L4 7Z"
  897. Fill="{Binding ElementName=BtnImgLayoutAlignRight, Path=Foreground}" />
  898. </RadioButton.Content>
  899. <i:Interaction.Triggers>
  900. <i:EventTrigger EventName="Checked">
  901. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignRight, Path=Tag}" />
  902. </i:EventTrigger>
  903. </i:Interaction.Triggers>
  904. </RadioButton>
  905. <RadioButton
  906. x:Name="BtnImgLayoutAlignDistributeHorizontal"
  907. Grid.Row="0"
  908. Grid.Column="3"
  909. Width="32"
  910. Height="32"
  911. VerticalContentAlignment="Center"
  912. Background="Transparent"
  913. Foreground="#616469"
  914. GroupName="ImgAlign"
  915. IsEnabled="{Binding IsLayoutAvgAlign}"
  916. Style="{DynamicResource GreyBgRadioBtnStyle}"
  917. Tag="DistributeHorizontal">
  918. <RadioButton.Content>
  919. <Path
  920. Margin="5,0,0,0"
  921. Data="M15 12.5L1 12.5L1 14L15 14L15 12.5ZM12 9.5L4 9.5L4 6.5L12 6.5L12 9.5ZM1 2L15 2L15 3.5L1 3.5L1 2Z"
  922. Fill="{Binding ElementName=BtnImgLayoutAlignDistributeHorizontal, Path=Foreground}" />
  923. </RadioButton.Content>
  924. <i:Interaction.Triggers>
  925. <i:EventTrigger EventName="Checked">
  926. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignDistributeHorizontal, Path=Tag}" />
  927. </i:EventTrigger>
  928. </i:Interaction.Triggers>
  929. </RadioButton>
  930. <RadioButton
  931. x:Name="BtnImgLayoutAlignTop"
  932. Grid.Row="1"
  933. Grid.Column="0"
  934. Width="32"
  935. Height="32"
  936. VerticalContentAlignment="Center"
  937. Background="Transparent"
  938. Foreground="#616469"
  939. GroupName="ImgAlign"
  940. IsEnabled="{Binding IsLayoutAlign}"
  941. Style="{DynamicResource GreyBgRadioBtnStyle}"
  942. Tag="AlignTop">
  943. <RadioButton.Content>
  944. <Path
  945. Margin="5,0,0,0"
  946. Data="M15 2L1 2L1 3.5L15 3.5L15 2ZM12 5L12 11L9 11L9 5L12 5ZM7 5L7 14L4 14L4 5L7 5Z"
  947. Fill="{Binding ElementName=BtnImgLayoutAlignTop, Path=Foreground}" />
  948. </RadioButton.Content>
  949. <i:Interaction.Triggers>
  950. <i:EventTrigger EventName="Checked">
  951. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignTop, Path=Tag}" />
  952. </i:EventTrigger>
  953. </i:Interaction.Triggers>
  954. </RadioButton>
  955. <RadioButton
  956. x:Name="BtnImgLayoutAlignVerticalCenter"
  957. Grid.Row="1"
  958. Grid.Column="1"
  959. Width="32"
  960. Height="32"
  961. VerticalContentAlignment="Center"
  962. Background="Transparent"
  963. Foreground="#616469"
  964. GroupName="ImgAlign"
  965. IsEnabled="{Binding IsLayoutAlign}"
  966. Style="{DynamicResource GreyBgRadioBtnStyle}"
  967. Tag="AlignVerticalCenter">
  968. <RadioButton.Content>
  969. <Path
  970. Margin="5,0,0,0"
  971. Data="M7 7.25L9 7.25L9 4L12 4L12 7.25L15 7.25L15 8.75L12 8.75L12 12L9 12L9 8.75L7 8.75L7 14L4 14L4 8.75L1 8.75L1 7.25L4 7.25L4 2L7 2L7 7.25Z"
  972. Fill="{Binding ElementName=BtnImgLayoutAlignVerticalCenter, Path=Foreground}" />
  973. </RadioButton.Content>
  974. <i:Interaction.Triggers>
  975. <i:EventTrigger EventName="Checked">
  976. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignVerticalCenter, Path=Tag}" />
  977. </i:EventTrigger>
  978. </i:Interaction.Triggers>
  979. </RadioButton>
  980. <RadioButton
  981. x:Name="BtnImgLayoutAlignBottom"
  982. Grid.Row="1"
  983. Grid.Column="2"
  984. Width="32"
  985. Height="32"
  986. VerticalContentAlignment="Center"
  987. Background="Transparent"
  988. Foreground="#616469"
  989. GroupName="ImgAlign"
  990. IsEnabled="{Binding IsLayoutAlign}"
  991. Style="{DynamicResource GreyBgRadioBtnStyle}"
  992. Tag="AlignBottom">
  993. <RadioButton.Content>
  994. <Path
  995. Margin="5,0,0,0"
  996. Data="M9 2H12V11H9V2ZM4 5H7V11H4V5ZM1 14H15V12.5H1V14Z"
  997. Fill="{Binding ElementName=BtnImgLayoutAlignBottom, Path=Foreground}" />
  998. </RadioButton.Content>
  999. <i:Interaction.Triggers>
  1000. <i:EventTrigger EventName="Checked">
  1001. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutAlignBottom, Path=Tag}" />
  1002. </i:EventTrigger>
  1003. </i:Interaction.Triggers>
  1004. </RadioButton>
  1005. <RadioButton
  1006. x:Name="BtnImgLayoutDistributeVertical"
  1007. Grid.Row="1"
  1008. Grid.Column="3"
  1009. Width="32"
  1010. Height="32"
  1011. VerticalContentAlignment="Center"
  1012. Background="Transparent"
  1013. Foreground="#616469"
  1014. GroupName="ImgAlign"
  1015. IsEnabled="{Binding IsLayoutAvgAlign}"
  1016. Style="{DynamicResource GreyBgRadioBtnStyle}"
  1017. Tag="DistributeVertical">
  1018. <RadioButton.Content>
  1019. <Path
  1020. Margin="5,0,0,0"
  1021. Data="M2 15V1H3.5V15H2ZM6.5 4H9.5V12H6.5V4ZM12.5 1V15H14V1H12.5Z"
  1022. Fill="{Binding ElementName=BtnImgLayoutDistributeVertical, Path=Foreground}" />
  1023. </RadioButton.Content>
  1024. <i:Interaction.Triggers>
  1025. <i:EventTrigger EventName="Checked">
  1026. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgLayoutDistributeVertical, Path=Tag}" />
  1027. </i:EventTrigger>
  1028. </i:Interaction.Triggers>
  1029. </RadioButton>
  1030. </Grid>
  1031. </Grid>
  1032. </UserControl>