TextEditProperty.xaml 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.TextEditProperty"
  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"
  7. xmlns:prism="http://prismlibrary.com/"
  8. prism:ViewModelLocator.AutoWireViewModel="True"
  9. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
  11. xmlns:cusColor="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  12. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  13. xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  14. mc:Ignorable="d"
  15. d:DesignHeight="450" d:DesignWidth="800"
  16. Loaded="UserControl_Loaded"
  17. >
  18. <UserControl.Resources>
  19. <ResourceDictionary>
  20. <ResourceDictionary.MergedDictionaries>
  21. <ResourceDictionary Source="../../Styles/SliderStyle.xaml"></ResourceDictionary>
  22. <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml"/>
  23. <ResourceDictionary Source="../../Styles/RadioButtonStyle.xaml"/>
  24. </ResourceDictionary.MergedDictionaries>
  25. <Convert:BoolToVisible x:Key="BoolToVisible"/>
  26. <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
  27. <Convert:InvertBoolConvert x:Key="InvertBoolConvert"/>
  28. <ContextMenu x:Key="BtnFlyoutMenu" FontSize="14"
  29. >
  30. <ContextMenu.ItemContainerStyle>
  31. <Style TargetType="MenuItem">
  32. <Setter Property="Padding" Value="0,7,0,7"/>
  33. <Setter Property="VerticalContentAlignment" Value="Center"/>
  34. </Style>
  35. </ContextMenu.ItemContainerStyle>
  36. <MenuItem Name="ChangeStyleMenuItem" Header="用所选部分重新定义" IsEnabled="True">
  37. </MenuItem>
  38. <MenuItem Name="BackStyleMenuItem" Header="恢复默认预设样式" IsEnabled="True">
  39. </MenuItem>
  40. </ContextMenu>
  41. <DataTemplate x:Key="FontStyleData">
  42. <Grid >
  43. <TextBlock Text="{Binding mFontStyleName}" Foreground="Black"/>
  44. </Grid>
  45. </DataTemplate>
  46. </ResourceDictionary>
  47. </UserControl.Resources>
  48. <Grid Background="#F3F3F3">
  49. <StackPanel Visibility="{Binding IsTextEdit,Converter={StaticResource BoolToVisible}}">
  50. <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freetext</TextBlock>
  51. <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
  52. <Grid>
  53. <Border Name="FreeTextBorder" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5">
  54. <TextBlock Name="SampleText"
  55. Foreground="{Binding SelectColor}"
  56. FontFamily="{Binding TextFontFamily}"
  57. FontWeight="{Binding TextFontWeights}"
  58. FontStyle="{Binding TextFontStyle}"
  59. FontSize="{Binding TextFontSize}"
  60. Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center">
  61. </TextBlock>
  62. </Border>
  63. <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
  64. <Path.Data>
  65. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  66. </Path.Data>
  67. </Path>
  68. <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,40,0,0" Visibility="Collapsed">
  69. <Path.Data>
  70. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  71. </Path.Data>
  72. </Path>
  73. <Path Name="SquigglyPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
  74. </Path>
  75. </Grid>
  76. </Border>
  77. <Border BorderBrush="#E2E3E6" Height="32" Margin="12,0,4,0" BorderThickness="0">
  78. <StackPanel Orientation="Horizontal">
  79. <ComboBox IsReadOnly="True" Name="FontTitleBox" Background="Transparent" Padding="10 10 0 0" Width="148" BorderThickness="1" BorderBrush="#FFE2E3E6"
  80. ItemsSource="{Binding FontStyleList}"
  81. ItemTemplate="{StaticResource FontStyleData}"
  82. >
  83. <i:Interaction.Triggers>
  84. <i:EventTrigger EventName="SelectionChanged">
  85. <i:InvokeCommandAction Command="{Binding SelectedFontStyleCommand}" CommandParameter="{Binding ElementName=FontTitleBox,Path=SelectedItem}"/>
  86. </i:EventTrigger>
  87. </i:Interaction.Triggers>
  88. </ComboBox>
  89. <Button Width="32" Height="32" ContextMenu="{StaticResource BtnFlyoutMenu}"/>
  90. </StackPanel>
  91. </Border>
  92. <TextBlock x:Name="FontText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,18,0,0" >Font</TextBlock>
  93. <Grid Margin="0,6,0,0">
  94. <Grid.ColumnDefinitions>
  95. <ColumnDefinition Width="auto"></ColumnDefinition>
  96. <ColumnDefinition Width="auto"></ColumnDefinition>
  97. </Grid.ColumnDefinitions>
  98. <Grid.RowDefinitions>
  99. <RowDefinition Height="auto"></RowDefinition>
  100. <RowDefinition Height="auto"></RowDefinition>
  101. <RowDefinition Height="auto"></RowDefinition>
  102. </Grid.RowDefinitions>
  103. <Border BorderBrush="#E2E3E6" Grid.ColumnSpan="2" Width="228" Height="32" Margin="12,0,4,0" BorderThickness="0">
  104. <Grid>
  105. <ComboBox IsReadOnly="True" Name="FontFamilyBox" Background="Transparent" Padding="10 10 0 0" BorderThickness="1" BorderBrush="#FFE2E3E6"
  106. >
  107. <ComboBox.ItemContainerStyle>
  108. <Style TargetType="{x:Type ComboBoxItem}">
  109. <Setter Property="Padding" Value="10 0 0 0"/>
  110. </Style>
  111. </ComboBox.ItemContainerStyle>
  112. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
  113. <TextBlock Text="Courier New" FontFamily="Courier New" Tag="Courier" FontSize="14"/>
  114. </ComboBoxItem>
  115. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
  116. <TextBlock Text="Arial" FontFamily="Arial" Tag="Helvetica" FontSize="14"/>
  117. </ComboBoxItem>
  118. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
  119. <TextBlock Text="Times New Roman" FontFamily="Times New Roman" Tag="Times Roman" FontSize="14"/>
  120. </ComboBoxItem>
  121. <i:Interaction.Triggers>
  122. <i:EventTrigger EventName="SelectionChanged">
  123. <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" CommandParameter="{Binding ElementName=FontFamilyBox,Path=SelectedIndex}"/>
  124. </i:EventTrigger>
  125. </i:Interaction.Triggers>
  126. </ComboBox>
  127. <TextBox Name="FontFamilyText" FontFamily="Segoe UI" FontSize="14" Background="White" Padding="10 0 0 0" Margin="2,0,25,0" IsReadOnly="True"
  128. BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
  129. </TextBox>
  130. </Grid>
  131. </Border>
  132. <cusColor:ColorSubContent x:Name="FontColorBox" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left"
  133. ></cusColor:ColorSubContent>
  134. <Border Grid.Row="1" BorderBrush="#E2E3E6" Width="148" Height="32" Margin="12,8,4,0" BorderThickness="0">
  135. <Grid>
  136. <ComboBox Name="FontStyleBox" IsReadOnly="True" BorderThickness="1" BorderBrush="#FFE2E3E6" Padding="10 10 0 0" Background="Transparent">
  137. <ComboBox.ItemContainerStyle>
  138. <Style TargetType="{x:Type ComboBoxItem}">
  139. <Setter Property="Padding" Value="10 0 0 0"/>
  140. </Style>
  141. </ComboBox.ItemContainerStyle>
  142. <ComboBoxItem x:Name="RegularItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Regular</ComboBoxItem>
  143. <ComboBoxItem x:Name="BoldItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold</ComboBoxItem>
  144. <ComboBoxItem x:Name="ItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Italic</ComboBoxItem>
  145. <ComboBoxItem x:Name="BoldItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold Italic</ComboBoxItem>
  146. <i:Interaction.Triggers>
  147. <i:EventTrigger EventName="SelectionChanged">
  148. <i:InvokeCommandAction Command="{Binding FontStyleChangedCommand}" CommandParameter="{Binding ElementName=FontStyleBox,Path=SelectedItem}"/>
  149. </i:EventTrigger>
  150. </i:Interaction.Triggers>
  151. </ComboBox>
  152. <TextBox Name="FontStyleText" IsReadOnly="True" FontFamily="Segoe UI" FontSize="14" Background="White" Padding="10 0 0 0" Height="20" Margin="2,0,35,0"
  153. BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
  154. </TextBox>
  155. </Grid>
  156. </Border>
  157. <Border Grid.Row="1" Grid.Column="1" BorderBrush="#E2E3E6" Width="80" Height="32" Margin="-1,8,0,0" BorderThickness="0">
  158. <Grid>
  159. <ComboBox Name="FontSizeBox" BorderThickness="1" Background="Transparent" BorderBrush="#FFE2E3E6"
  160. MaxDropDownHeight="200">
  161. <ComboBox.ItemContainerStyle>
  162. <Style TargetType="{x:Type ComboBoxItem}">
  163. <Setter Property="Padding" Value="10 0 0 0"/>
  164. </Style>
  165. </ComboBox.ItemContainerStyle>
  166. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">6</ComboBoxItem>
  167. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">8</ComboBoxItem>
  168. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">9</ComboBoxItem>
  169. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">10</ComboBoxItem>
  170. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">12</ComboBoxItem>
  171. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">14</ComboBoxItem>
  172. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">18</ComboBoxItem>
  173. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">20</ComboBoxItem>
  174. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">22</ComboBoxItem>
  175. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">24</ComboBoxItem>
  176. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">26</ComboBoxItem>
  177. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">28</ComboBoxItem>
  178. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">32</ComboBoxItem>
  179. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">36</ComboBoxItem>
  180. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">48</ComboBoxItem>
  181. <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">72</ComboBoxItem>
  182. <i:Interaction.Triggers>
  183. <i:EventTrigger EventName="SelectionChanged">
  184. <i:InvokeCommandAction Command="{Binding FontSizeChangedCommand}" CommandParameter="{Binding ElementName=FontSizeBox,Path=SelectedItem}"/>
  185. </i:EventTrigger>
  186. </i:Interaction.Triggers>
  187. </ComboBox>
  188. <TextBox Name="FontSizeText" FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Padding="10 0 0 0" Margin="2,0,35,0"
  189. BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" IsReadOnly="True">
  190. </TextBox>
  191. </Grid>
  192. </Border>
  193. <Border Grid.ColumnSpan="2" Grid.Row="2" Width="148" Margin="12,8,0,0" HorizontalAlignment="Left">
  194. <Grid Name="ToolGrid">
  195. <Grid.ColumnDefinitions>
  196. <ColumnDefinition Width="*"></ColumnDefinition>
  197. <ColumnDefinition Width="*"></ColumnDefinition>
  198. <ColumnDefinition Width="*"></ColumnDefinition>
  199. <ColumnDefinition Width="*"></ColumnDefinition>
  200. </Grid.ColumnDefinitions>
  201. <RadioButton x:Name="TextAlignLeftBtn" IsChecked="True" Tag="AlignLeft" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  202. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  203. <RadioButton.Content>
  204. <Grid Width="32" Height="32">
  205. <Canvas Margin="5,10,0,0">
  206. <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
  207. <Rectangle Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
  208. <Rectangle Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
  209. <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignLeftBtn,Path=Foreground}"/>
  210. </Canvas>
  211. </Grid>
  212. </RadioButton.Content>
  213. <i:Interaction.Triggers>
  214. <i:EventTrigger EventName="Checked">
  215. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn,Path=Tag}"/>
  216. </i:EventTrigger>
  217. </i:Interaction.Triggers>
  218. </RadioButton>
  219. <RadioButton x:Name="TextAlignCenterBtn" Grid.Column="1" Tag="AlignCenter" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  220. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  221. <RadioButton.Content>
  222. <Grid Width="32" Height="32">
  223. <Canvas Margin="5,10,0,0">
  224. <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
  225. <Rectangle Canvas.Left="3" Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
  226. <Rectangle Canvas.Left="3" Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
  227. <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignCenterBtn,Path=Foreground}"/>
  228. </Canvas>
  229. </Grid>
  230. </RadioButton.Content>
  231. <i:Interaction.Triggers>
  232. <i:EventTrigger EventName="Checked">
  233. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn,Path=Tag}"/>
  234. </i:EventTrigger>
  235. </i:Interaction.Triggers>
  236. </RadioButton>
  237. <RadioButton x:Name="TextAlignRightBtn" Grid.Column="2" Tag="AlignRight" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  238. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  239. <RadioButton.Content>
  240. <Grid Width="32" Height="32">
  241. <Canvas Margin="5,10,0,0">
  242. <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
  243. <Rectangle Canvas.Left="6" Canvas.Top="4.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
  244. <Rectangle Canvas.Left="6" Canvas.Top="12.25" Width="8" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
  245. <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignRightBtn,Path=Foreground}"/>
  246. </Canvas>
  247. </Grid>
  248. </RadioButton.Content>
  249. <i:Interaction.Triggers>
  250. <i:EventTrigger EventName="Checked">
  251. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn,Path=Tag}"/>
  252. </i:EventTrigger>
  253. </i:Interaction.Triggers>
  254. </RadioButton>
  255. <RadioButton x:Name="TextAlignBtn" Grid.Column="3" Tag="Align" GroupName="TextAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  256. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  257. <RadioButton.Content>
  258. <Grid Width="32" Height="32">
  259. <Canvas Margin="5,10,0,0">
  260. <Rectangle Canvas.Top="0.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
  261. <Rectangle Canvas.Top="8.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
  262. <Rectangle Canvas.Top="4.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
  263. <Rectangle Canvas.Top="12.25" Width="14" Height="1.5" StrokeThickness="1.5" Stroke="{Binding ElementName=TextAlignBtn,Path=Foreground}"/>
  264. </Canvas>
  265. </Grid>
  266. </RadioButton.Content>
  267. <i:Interaction.Triggers>
  268. <i:EventTrigger EventName="Checked">
  269. <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn,Path=Tag}"/>
  270. </i:EventTrigger>
  271. </i:Interaction.Triggers>
  272. </RadioButton>
  273. </Grid>
  274. </Border>
  275. </Grid>
  276. <TextBlock x:Name="AlignText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
  277. <Grid Width="150" HorizontalAlignment="Left" Margin="0,10,0,0">
  278. <Grid.RowDefinitions>
  279. <RowDefinition Height="*"/>
  280. <RowDefinition Height="*"/>
  281. </Grid.RowDefinitions>
  282. <Grid.ColumnDefinitions>
  283. <ColumnDefinition Width="*"/>
  284. <ColumnDefinition Width="*"/>
  285. <ColumnDefinition Width="*"/>
  286. <ColumnDefinition Width="*"/>
  287. </Grid.ColumnDefinitions>
  288. <RadioButton x:Name="BtnImgAlign" Grid.Row="0" Grid.Column="0" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  289. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  290. <RadioButton.Content>
  291. <Path Margin="5,0,0,0" Data="M2.01367 15V1H3.51367V15H2.01367ZM5 4H11V7H5V4ZM14 9H5V12H14V9Z"
  292. Fill="{Binding ElementName=BtnImgAlign,Path=Foreground}"/>
  293. </RadioButton.Content>
  294. <i:Interaction.Triggers>
  295. <i:EventTrigger EventName="Checked">
  296. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign,Path=Tag}"/>
  297. </i:EventTrigger>
  298. </i:Interaction.Triggers>
  299. </RadioButton>
  300. <RadioButton x:Name="BtnImgAlign2" Grid.Row="0" Grid.Column="1" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  301. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  302. <RadioButton.Content>
  303. <Path Margin="5,0,0,0" 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"
  304. Fill="{Binding ElementName=BtnImgAlign2,Path=Foreground}"/>
  305. </RadioButton.Content>
  306. <i:Interaction.Triggers>
  307. <i:EventTrigger EventName="Checked">
  308. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign2,Path=Tag}"/>
  309. </i:EventTrigger>
  310. </i:Interaction.Triggers>
  311. </RadioButton>
  312. <RadioButton x:Name="BtnImgAlign3" Grid.Row="0" Grid.Column="2" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  313. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  314. <RadioButton.Content>
  315. <Path Margin="5,0,0,0" Data="M14 1L14 15L12.5 15L12.5 1L14 1ZM11 12L2 12L2 9L11 9L11 12ZM4 7L11 7L11 4L4 4L4 7Z"
  316. Fill="{Binding ElementName=BtnImgAlign3,Path=Foreground}"/>
  317. </RadioButton.Content>
  318. <i:Interaction.Triggers>
  319. <i:EventTrigger EventName="Checked">
  320. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign3,Path=Tag}"/>
  321. </i:EventTrigger>
  322. </i:Interaction.Triggers>
  323. </RadioButton>
  324. <RadioButton x:Name="BtnImgAlign4" Grid.Row="0" Grid.Column="3" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  325. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  326. <RadioButton.Content>
  327. <Path Margin="5,0,0,0" 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"
  328. Fill="{Binding ElementName=BtnImgAlign4,Path=Foreground}"/>
  329. </RadioButton.Content>
  330. <i:Interaction.Triggers>
  331. <i:EventTrigger EventName="Checked">
  332. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign4,Path=Tag}"/>
  333. </i:EventTrigger>
  334. </i:Interaction.Triggers>
  335. </RadioButton>
  336. <RadioButton x:Name="BtnImgAlign5" Grid.Row="1" Grid.Column="0" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  337. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  338. <RadioButton.Content>
  339. <Path Margin="5,0,0,0" Data="M15 2L1 2L1 3.5L15 3.5L15 2ZM12 5L12 11L9 11L9 5L12 5ZM7 5L7 14L4 14L4 5L7 5Z"
  340. Fill="{Binding ElementName=BtnImgAlign5,Path=Foreground}"/>
  341. </RadioButton.Content>
  342. <i:Interaction.Triggers>
  343. <i:EventTrigger EventName="Checked">
  344. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign5,Path=Tag}"/>
  345. </i:EventTrigger>
  346. </i:Interaction.Triggers>
  347. </RadioButton>
  348. <RadioButton x:Name="BtnImgAlign6" Grid.Row="1" Grid.Column="1" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  349. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  350. <RadioButton.Content>
  351. <Path Margin="5,0,0,0" 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"
  352. Fill="{Binding ElementName=BtnImgAlign6,Path=Foreground}"/>
  353. </RadioButton.Content>
  354. <i:Interaction.Triggers>
  355. <i:EventTrigger EventName="Checked">
  356. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign6,Path=Tag}"/>
  357. </i:EventTrigger>
  358. </i:Interaction.Triggers>
  359. </RadioButton>
  360. <RadioButton x:Name="BtnImgAlign7" Grid.Row="1" Grid.Column="2" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  361. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  362. <RadioButton.Content>
  363. <Path Margin="5,0,0,0" Data="M9 2H12V11H9V2ZM4 5H7V11H4V5ZM1 14H15V12.5H1V14Z"
  364. Fill="{Binding ElementName=BtnImgAlign7,Path=Foreground}"/>
  365. </RadioButton.Content>
  366. <i:Interaction.Triggers>
  367. <i:EventTrigger EventName="Checked">
  368. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign7,Path=Tag}"/>
  369. </i:EventTrigger>
  370. </i:Interaction.Triggers>
  371. </RadioButton>
  372. <RadioButton x:Name="BtnImgAlign8" Grid.Row="1" Grid.Column="3" Tag="Align" GroupName="ImgAlign" Width="32" Height="32" Foreground="#616469" Background="Transparent" VerticalContentAlignment="Center"
  373. Style="{DynamicResource GreyBgRadioBtnStyle}" >
  374. <RadioButton.Content>
  375. <Path Margin="5,0,0,0" Data="M2 15V1H3.5V15H2ZM6.5 4H9.5V12H6.5V4ZM12.5 1V15H14V1H12.5Z"
  376. Fill="{Binding ElementName=BtnImgAlign8,Path=Foreground}"/>
  377. </RadioButton.Content>
  378. <i:Interaction.Triggers>
  379. <i:EventTrigger EventName="Checked">
  380. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=BtnImgAlign8,Path=Tag}"/>
  381. </i:EventTrigger>
  382. </i:Interaction.Triggers>
  383. </RadioButton>
  384. </Grid>
  385. </StackPanel>
  386. <StackPanel Visibility="{Binding IsTextEdit,Converter={StaticResource InvertBoolToVisibleConvert}}">
  387. <TextBlock Name="AnnotTypeTitle1" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Image</TextBlock>
  388. <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
  389. <Grid>
  390. <Border Name="FreeTextBorder1" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5" >
  391. <Image x:Name="ImgExmple" Source="{Binding CurrentImg}">
  392. <Image.RenderTransform>
  393. <RotateTransform x:Name="test" Angle="{Binding Angle}"/>
  394. </Image.RenderTransform>
  395. </Image>
  396. </Border>
  397. </Grid>
  398. </Border>
  399. <StackPanel Orientation="Horizontal" Margin="0,18,0,0" HorizontalAlignment="Center">
  400. <Button Margin="0,0,20,0" Content="逆转" Width="32" Height="32"
  401. IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
  402. Command="{Binding AntiClockwiseCommand}"/>
  403. <Button Content="顺转" Width="32" Height="32"
  404. IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
  405. Command="{Binding ClockwiseCommand}"/>
  406. </StackPanel>
  407. <CompositeControl:SlidComboControl IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"/>
  408. <StackPanel Width="228" HorizontalAlignment="Center" Margin="0,20,0,0">
  409. <Grid x:Name="GridCrop">
  410. <cus:CustomIconToggleBtn x:Name="BtnCrop" Tag="Crop" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}"
  411. Foreground="Black" ContentStringFormat="156"
  412. Command="{Binding CropModeCommand}"
  413. Visibility="{Binding IsCrop,Converter={StaticResource InvertBoolToVisibleConvert}}"
  414. >
  415. <TextBlock Text="Crop"/>
  416. </cus:CustomIconToggleBtn>
  417. <Grid Visibility="{Binding IsCrop,Converter={StaticResource BoolToVisible}}">
  418. <Grid.ColumnDefinitions>
  419. <ColumnDefinition Width="*"/>
  420. <ColumnDefinition Width="8"/>
  421. <ColumnDefinition Width="*"/>
  422. </Grid.ColumnDefinitions>
  423. <Button Content="Confirm" Background="#1770F4" Height="32" Command="{Binding CropImgCommand}"/>
  424. <Button Grid.Column="2" Content="Cancel" Background="White" BorderBrush="#DFE1E5" BorderThickness="1"
  425. Command="{Binding CancelCropCommand}"
  426. />
  427. </Grid>
  428. </Grid>
  429. <cus:CustomIconToggleBtn x:Name="BtnReplace" Margin="0,13,0,0" Tag="Replace" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}"
  430. Foreground="Black" ContentStringFormat="156"
  431. IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
  432. Command="{Binding ReplaceImgCommand}"
  433. >
  434. <TextBlock Text="Replace"/>
  435. </cus:CustomIconToggleBtn>
  436. <cus:CustomIconToggleBtn x:Name="BtnExtract" Margin="0,13,0,0" Tag="Extract" BorderBrush="#DFE1E5" BorderThickness="1" Style="{StaticResource ToggleBtnViewModeStyle}"
  437. Foreground="Black" ContentStringFormat="156"
  438. IsEnabled="{Binding IsCrop,Converter={StaticResource InvertBoolConvert}}"
  439. Command="{Binding ExportImgCommand}"
  440. >
  441. <TextBlock Text="Extract"/>
  442. </cus:CustomIconToggleBtn>
  443. </StackPanel>
  444. </StackPanel>
  445. </Grid>
  446. </UserControl>