ImageEditProperty.xaml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <UserControl
  2. x:Class="PDF_Office.Views.PropertyPanel.PDFEdit.ImageEditProperty"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  6. xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
  7. xmlns:FormControl="clr-namespace:PDF_Office.CustomControl.Form"
  8. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  9. xmlns: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.PDFEdit"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:prism="http://prismlibrary.com/"
  14. d:DesignHeight="600"
  15. d:DesignWidth="260"
  16. prism:ViewModelLocator.AutoWireViewModel="True"
  17. mc:Ignorable="d">
  18. <UserControl.Resources>
  19. <ResourceDictionary>
  20. <ResourceDictionary.MergedDictionaries>
  21. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
  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. </ResourceDictionary>
  29. </UserControl.Resources>
  30. <Grid Background="{StaticResource color.sys.layout.mg}">
  31. <StackPanel Margin="16,14">
  32. <TextBlock
  33. Name="AnnotTypeTitle1"
  34. HorizontalAlignment="Left"
  35. FontFamily="Segoe UI"
  36. FontSize="14"
  37. FontWeight="SemiBold"
  38. LineHeight="24">
  39. Image
  40. </TextBlock>
  41. <Border
  42. Width="228"
  43. Height="88"
  44. Margin="0,8,0,0"
  45. Background="{StaticResource color.field.bg.def}"
  46. BorderBrush="{StaticResource color.field.border.norm}"
  47. BorderThickness="1"
  48. CornerRadius="2"
  49. Visibility="{Binding IsMultiSelectImage, Converter={StaticResource InvertBoolToVisibleConvert}}">
  50. <Grid>
  51. <Border
  52. Name="FreeTextBorder1"
  53. Padding="5"
  54. HorizontalAlignment="Center"
  55. VerticalAlignment="Center" Opacity="{Binding OpacityUI,Mode=OneWay}">
  56. <Image x:Name="ImgExmple" Source="{Binding CurrentImg}">
  57. </Image>
  58. </Border>
  59. </Grid>
  60. </Border>
  61. <StackPanel
  62. Margin="0,8,0,0"
  63. HorizontalAlignment="Center"
  64. Orientation="Horizontal">
  65. <Button
  66. Width="32"
  67. Height="32"
  68. Margin="0,0,8,0"
  69. Command="{Binding AntiClockwiseCommand}"
  70. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  71. Style="{StaticResource subToolBar}">
  72. <Path Data="M11.9784 2.52529C8.94121 0.771787 5.05761 1.81239 3.30411 4.84955C3.00688 5.36436 2.78981 5.90407 2.64922 6.45385L2.1804 4.70416L0.731506 5.09239L1.68396 8.647C1.79117 9.0471 2.20242 9.28453 2.60252 9.17733L6.15713 8.22487L5.7689 6.77598L4.01473 7.24601C4.10628 6.68216 4.2999 6.1248 4.60315 5.59955C5.94244 3.27983 8.90865 2.48504 11.2284 3.82433C13.5481 5.16362 14.3429 8.12983 13.0036 10.4496C11.6643 12.7693 8.69809 13.5641 6.37837 12.2248L5.62837 13.5238C8.66553 15.2773 12.5491 14.2367 14.3026 11.1996C16.0561 8.16239 15.0155 4.2788 11.9784 2.52529Z" Fill="{StaticResource color.icon.base.brand}" />
  73. </Button>
  74. <Button
  75. Width="32"
  76. Height="32"
  77. Command="{Binding ClockwiseCommand}"
  78. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  79. Style="{StaticResource subToolBar}">
  80. <Path Data="M11.9922 7.24898C11.6312 4.92704 9.62312 3.15002 7.19998 3.15002C4.52139 3.15002 2.34998 5.32144 2.34998 8.00002C2.34998 10.6786 4.52139 12.85 7.19998 12.85C8.08462 12.85 8.91183 12.6139 9.62443 12.2016L10.3755 13.5C9.44076 14.0408 8.35534 14.35 7.19998 14.35C3.69297 14.35 0.849976 11.507 0.849976 8.00002C0.849976 4.49302 3.69297 1.65002 7.19998 1.65002C10.1642 1.65002 12.6541 3.68116 13.3538 6.42761L13.8156 4.7042L15.2645 5.09243L14.312 8.64704C14.2048 9.04714 13.7935 9.28457 13.3934 9.17737L9.83884 8.22491L10.2271 6.77602L11.9922 7.24898Z" Fill="{StaticResource color.icon.base.brand}" />
  81. </Button>
  82. </StackPanel>
  83. <CompositeControl:SlidComboControl
  84. x:Name="slid"
  85. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  86. Value="{Binding Transpent, Mode=TwoWay}" />
  87. <StackPanel
  88. Width="228"
  89. Margin="0,16,0,0"
  90. HorizontalAlignment="Center">
  91. <Grid x:Name="GridCrop" Visibility="{Binding IsMultiSelectImage, Converter={StaticResource InvertBoolToVisibleConvert}}">
  92. <Button
  93. x:Name="BtnCrop"
  94. Height="32"
  95. BorderBrush="#DFE1E5"
  96. BorderThickness="1"
  97. Command="{Binding CropModeCommand}"
  98. Content="Crop"
  99. ContentStringFormat="156"
  100. FontSize="14"
  101. Foreground="Black"
  102. Style="{StaticResource btn.sec}"
  103. Tag="Crop"
  104. Visibility="{Binding IsCrop, Converter={StaticResource InvertBoolToVisibleConvert}}" />
  105. <Grid Visibility="{Binding IsCrop, Converter={StaticResource BoolToVisible}}">
  106. <Grid.ColumnDefinitions>
  107. <ColumnDefinition Width="*" />
  108. <ColumnDefinition Width="8" />
  109. <ColumnDefinition Width="*" />
  110. </Grid.ColumnDefinitions>
  111. <Button
  112. Height="32"
  113. Command="{Binding CropImgCommand}"
  114. Content="Confirm Cut"
  115. FontSize="14"
  116. Style="{StaticResource Btn.cta}" />
  117. <Button
  118. Grid.Column="2"
  119. Background="White"
  120. BorderBrush="#DFE1E5"
  121. BorderThickness="1"
  122. Command="{Binding CancelCropCommand}"
  123. Content="Cancel"
  124. FontSize="14"
  125. Style="{StaticResource btn.sec}" />
  126. </Grid>
  127. </Grid>
  128. <Button
  129. x:Name="BtnReplace"
  130. Height="32"
  131. Margin="0,8"
  132. VerticalAlignment="Center"
  133. BorderBrush="#DFE1E5"
  134. BorderThickness="1"
  135. Command="{Binding ReplaceImgCommand}"
  136. Content="Replace"
  137. FontSize="14"
  138. Foreground="Black"
  139. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  140. Style="{StaticResource btn.sec}"
  141. Tag="Replace"
  142. Visibility="{Binding IsMultiSelectImage, Converter={StaticResource InvertBoolToVisibleConvert}}" />
  143. <Button
  144. x:Name="BtnExtract"
  145. Height="32"
  146. BorderBrush="#DFE1E5"
  147. BorderThickness="1"
  148. Command="{Binding ExportImgCommand}"
  149. ContentStringFormat="156"
  150. FontSize="14"
  151. Foreground="Black"
  152. IsEnabled="{Binding IsCrop, Converter={StaticResource InvertBoolConvert}}"
  153. Style="{StaticResource btn.sec}"
  154. Tag="Extract">
  155. <TextBlock Text="Extract" />
  156. </Button>
  157. </StackPanel>
  158. <TextBlock
  159. x:Name="AlignImg"
  160. Margin="0,18,0,10"
  161. FontFamily="Segoe UI"
  162. FontSize="12"
  163. FontWeight="SemiBold"
  164. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  165. LineHeight="20">
  166. Align
  167. </TextBlock>
  168. <FormControl:LayoutAglinContent
  169. x:Name="laoutAglin"
  170. IsLayoutAlign="{Binding IsLayoutAlign}"
  171. IsLayoutAvgAlign="{Binding IsLayoutAvgAlign}">
  172. <i:Interaction.Triggers>
  173. <i:EventTrigger EventName="ValueChanged">
  174. <i:InvokeCommandAction Command="{Binding ImgAlignCheckedCommand}" CommandParameter="{Binding ElementName=laoutAglin, Path=Btntag}" />
  175. </i:EventTrigger>
  176. </i:Interaction.Triggers>
  177. </FormControl:LayoutAglinContent>
  178. </StackPanel>
  179. </Grid>
  180. </UserControl>