TextEditProperty.xaml 38 KB

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