ConverterTextDialog.xaml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <UserControl
  2. x:Class="PDF_Master.Views.Dialog.ConverterDialogs.ConverterTextDialog"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:converterdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.ConverterDialogs"
  6. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:local="clr-namespace:PDF_Master.Views.Dialog.PageEditDialogs"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. xmlns:pageeditdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.PageEditDialogs"
  12. xmlns:prism="http://prismlibrary.com/"
  13. Width="468"
  14. Height="478"
  15. d:DataContext="{d:DesignInstance Type=converterdialogs:ConverterTextDialogViewModel}"
  16. d:DesignHeight="478"
  17. d:DesignWidth="468"
  18. prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
  19. prism:ViewModelLocator.AutoWireViewModel="True"
  20. mc:Ignorable="d">
  21. <cus:DialogContent Header="{Binding T_Title}">
  22. <cus:DialogContent.Content>
  23. <Grid Grid.Row="1">
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="244" />
  26. <ColumnDefinition Width="*" />
  27. </Grid.ColumnDefinitions>
  28. <Grid Grid.Column="0" VerticalAlignment="Top">
  29. <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" />
  30. </Grid>
  31. <Grid Grid.Column="1">
  32. <StackPanel Margin="0,2,0,0" Orientation="Vertical">
  33. <StackPanel Orientation="Vertical" Visibility="Visible">
  34. <TextBlock
  35. Height="20"
  36. HorizontalAlignment="Left"
  37. Style="{StaticResource PropertyHeaderLv2}"
  38. Text="Text Recognition Settings" />
  39. <CheckBox
  40. Name="OCRCheckBox"
  41. Margin="0,10,0,0"
  42. Padding="8,0,0,0"
  43. Command="{Binding OpenOCRCommand}"
  44. IsChecked="{Binding OCRCheckBoxIsCheckBox}">
  45. <TextBlock Text="Recognize text if needed" />
  46. </CheckBox>
  47. <ComboBox
  48. Width="208"
  49. Height="32"
  50. Margin="0,8,0,8"
  51. HorizontalAlignment="Left"
  52. IsEnabled="{Binding ElementName=OCRCheckBox, Path=IsChecked}"
  53. SelectedIndex="{Binding LanguageSelectedIndex}">
  54. <ComboBoxItem Content="Chinese Simplified" />
  55. <ComboBoxItem Content="Chinese Traditional" />
  56. <ComboBoxItem Content="English" />
  57. <ComboBoxItem Content="Japanese" />
  58. <ComboBoxItem Content="Korean" />
  59. </ComboBox>
  60. </StackPanel>
  61. <StackPanel Margin="0,0,0,0" Orientation="Vertical">
  62. <TextBlock
  63. Height="20"
  64. HorizontalAlignment="Left"
  65. Style="{StaticResource PropertyHeaderLv2}"
  66. Text="{Binding T_PageRange}" />
  67. <cus:WritableComboBox
  68. x:Name="PageRangeComboBox"
  69. Width="208"
  70. Height="32"
  71. Margin="0,10,0,0"
  72. HorizontalAlignment="Left"
  73. IsCurrentPage="True"
  74. Loaded="PageRangeComboBox_Loaded"
  75. MaxPageRange="{Binding MaxPageRange}"
  76. SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}"
  77. Text="{Binding PageRangeText, Mode=TwoWay}">
  78. <i:Interaction.Triggers>
  79. <i:EventTrigger EventName="SelectionChanged">
  80. <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
  81. </i:EventTrigger>
  82. <i:EventTrigger EventName="TextChanged">
  83. <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
  84. </i:EventTrigger>
  85. <i:KeyTrigger Key="Return" FiredOn="KeyDown">
  86. <i:InvokeCommandAction Command="{Binding SetCustomPageRangeCommand}" />
  87. </i:KeyTrigger>
  88. </i:Interaction.Triggers>
  89. </cus:WritableComboBox>
  90. </StackPanel>
  91. </StackPanel>
  92. </Grid>
  93. <StackPanel
  94. Grid.ColumnSpan="2"
  95. Height="20"
  96. Margin="0,0,16,8"
  97. HorizontalAlignment="Right"
  98. VerticalAlignment="Bottom"
  99. Panel.ZIndex="2"
  100. Orientation="Horizontal"
  101. Visibility="{Binding LimitationsConvertVisible}">
  102. <Grid Width="16" Height="16">
  103. <Ellipse
  104. Width="13"
  105. Height="13"
  106. Fill="white"
  107. Stroke="#CED0D4" />
  108. <Path Data="M7.4701 8.91H8.5001L8.7601 5.49L8.8101 4H7.1601L7.2101 5.49L7.4701 8.91ZM7.9901 11.58C8.4901 11.58 8.8701 11.21 8.8701 10.69C8.8701 10.17 8.4901 9.81 7.9901 9.81C7.4801 9.81 7.1001 10.17 7.1001 10.69C7.1001 11.21 7.4701 11.58 7.9901 11.58Z" Fill="#94989C" />
  109. </Grid>
  110. <TextBlock
  111. Height="20"
  112. Margin="4,0,0,0"
  113. FontFamily="Segoe UI"
  114. FontSize="12"
  115. Foreground="#252629"
  116. Text="First 10 pages for free conversion." />
  117. <TextBlock
  118. Height="20"
  119. Margin="8,0,0,0"
  120. FontFamily="Segoe UI"
  121. FontSize="12"
  122. Foreground="{StaticResource color.light.blue.5}">
  123. <i:Interaction.Triggers>
  124. <i:EventTrigger EventName="MouseDown">
  125. <i:InvokeCommandAction Command="{Binding UnlockMouseDownCommand}" />
  126. </i:EventTrigger>
  127. </i:Interaction.Triggers>
  128. <Underline>
  129. <TextBlock Text="{Binding TextUpgrade}" />
  130. </Underline>
  131. </TextBlock>
  132. </StackPanel>
  133. </Grid>
  134. </cus:DialogContent.Content>
  135. <cus:DialogContent.BottmBar>
  136. <Grid>
  137. <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
  138. <Border>
  139. <TextBlock Text="批量处理" ></TextBlock>
  140. </Border>
  141. </Button>-->
  142. <Button
  143. Width="98"
  144. Height="32"
  145. Margin="0,0,16,0"
  146. HorizontalAlignment="Right"
  147. Command="{Binding CancelCommand}"
  148. Content="{Binding T_No}"
  149. Style="{StaticResource btn.sec}">
  150. <i:Interaction.Triggers>
  151. <i:EventTrigger EventName="PreviewMouseDown">
  152. <i:InvokeCommandAction Command="{Binding PreviewCancelDownCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}" />
  153. </i:EventTrigger>
  154. </i:Interaction.Triggers>
  155. </Button>
  156. <Button
  157. Width="98"
  158. Height="32"
  159. Margin="124,0"
  160. HorizontalAlignment="Right"
  161. Command="{Binding ConverterCommnad}"
  162. Content="{Binding T_YES}"
  163. Style="{StaticResource Btn.cta}" />
  164. </Grid>
  165. </cus:DialogContent.BottmBar>
  166. </cus:DialogContent>
  167. </UserControl>