ConverterExcelDialog.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <UserControl
  2. x:Class="PDF_Master.Views.Dialog.ConverterDialogs.ConverterExcelDialog"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:local="clr-namespace:PDF_Master.Views.Dialog.PageEditDialogs"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:pageeditdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.PageEditDialogs"
  11. xmlns:prism="http://prismlibrary.com/"
  12. Width="586"
  13. Height="522"
  14. d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
  15. d:DesignHeight="522"
  16. d:DesignWidth="586"
  17. prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
  18. prism:ViewModelLocator.AutoWireViewModel="True"
  19. mc:Ignorable="d">
  20. <cus:DialogContent Header="{Binding T_Title}">
  21. <cus:DialogContent.Content>
  22. <Grid Grid.Row="1">
  23. <Grid.ColumnDefinitions>
  24. <ColumnDefinition Width="244" />
  25. <ColumnDefinition Width="*" />
  26. </Grid.ColumnDefinitions>
  27. <Grid Grid.Column="0">
  28. <cus:PageTurningPreview
  29. x:Name="ConverterPreview"
  30. VerticalAlignment="Top"
  31. Loaded="ConverterPreview_Loaded" />
  32. </Grid>
  33. <Grid Grid.Column="1">
  34. <StackPanel Margin="0,2,0,0" Orientation="Vertical">
  35. <StackPanel Orientation="Vertical">
  36. <TextBlock
  37. Height="20"
  38. Style="{StaticResource PropertyHeaderLv2}"
  39. Text="{Binding T_Settings}" />
  40. <StackPanel Margin="0,10,0,0" Orientation="Vertical">
  41. <RadioButton
  42. Name="AnyContentRadioBtn"
  43. Command="{Binding RadioButtonCommand}"
  44. CommandParameter="{Binding ElementName=AnyContentRadioBtn, Path=Name}"
  45. IsChecked="True"
  46. Style="{StaticResource RadioButtonStyleText}">
  47. <TextBlock Text="{Binding T_AllContents}" />
  48. </RadioButton>
  49. <ComboBox
  50. Width="326"
  51. Height="32"
  52. Margin="0,8,0,0"
  53. HorizontalAlignment="Left"
  54. IsEnabled="{Binding ElementName=AnyContentRadioBtn, Path=IsChecked}"
  55. SelectedIndex="{Binding AnyContentSelectIndex}">
  56. <ComboBoxItem Content="{Binding T_EachPageAllContents}" />
  57. <ComboBoxItem Content="{Binding T_FileAllContents}" />
  58. </ComboBox>
  59. <RadioButton
  60. Name="OnlyTableRadioBtn"
  61. Margin="0,8,0,0"
  62. Padding="8,0,0,0"
  63. Command="{Binding RadioButtonCommand}"
  64. CommandParameter="{Binding ElementName=OnlyTableRadioBtn, Path=Name}"
  65. Style="{StaticResource RadioButtonStyleText}">
  66. <TextBlock Text="{Binding T_OnlyTables}" />
  67. </RadioButton>
  68. <ComboBox
  69. Name="OnlyTableComboBox"
  70. Width="326"
  71. Height="32"
  72. Margin="0,8,0,0"
  73. HorizontalAlignment="Left"
  74. IsEnabled="{Binding ElementName=OnlyTableRadioBtn, Path=IsChecked}"
  75. SelectedIndex="{Binding OnlyTableSelectIndex}">
  76. <ComboBoxItem Content="{Binding T_EachTableOnlyTables}" />
  77. <ComboBoxItem Content="{Binding T_EachPageOnlyTables}" />
  78. <ComboBoxItem Content="{Binding T_FileOnlyTables}" />
  79. </ComboBox>
  80. <RadioButton
  81. Name="OnlyTextRadioBtn"
  82. Margin="0,8,0,0"
  83. Padding="8,0,0,0"
  84. Command="{Binding RadioButtonCommand}"
  85. CommandParameter="{Binding ElementName=OnlyTextRadioBtn, Path=Name}"
  86. Style="{StaticResource RadioButtonStyleText}">
  87. <TextBlock Text="{Binding T_OnlyText}" />
  88. </RadioButton>
  89. </StackPanel>
  90. </StackPanel>
  91. <StackPanel Margin="0,18,0,0" Orientation="Vertical">
  92. <StackPanel
  93. IsEnabled="{Binding OCRIsEnable}"
  94. Orientation="Vertical"
  95. Visibility="Visible">
  96. <TextBlock
  97. Height="20"
  98. HorizontalAlignment="Left"
  99. Style="{StaticResource PropertyHeaderLv2}"
  100. Text="Text Recognition Settings:" />
  101. <CheckBox
  102. Name="OCRCheckBox"
  103. Margin="0,10,0,0"
  104. Padding="8,0,0,0"
  105. Command="{Binding OpenOCRCommand}"
  106. IsChecked="{Binding OCRCheckBoxIsCheckBox}">
  107. <TextBlock Text="Recognize text if needed" />
  108. </CheckBox>
  109. <ComboBox
  110. Width="326"
  111. Height="32"
  112. Margin="0,8,0,0"
  113. HorizontalAlignment="Left"
  114. IsEnabled="{Binding ElementName=OCRCheckBox, Path=IsChecked}"
  115. SelectedIndex="{Binding LanguageSelectedIndex}">
  116. <ComboBoxItem Content="Chinese Simplified" />
  117. <ComboBoxItem Content="Chinese Traditional" />
  118. <ComboBoxItem Content="English" />
  119. <ComboBoxItem Content="Japanese" />
  120. <ComboBoxItem Content="Korean" />
  121. </ComboBox>
  122. </StackPanel>
  123. <StackPanel Margin="0,18,0,0" Orientation="Vertical">
  124. <TextBlock
  125. Height="20"
  126. HorizontalAlignment="Left"
  127. Style="{StaticResource PropertyHeaderLv2}"
  128. Text="{Binding T_PageRange}" />
  129. <cus:WritableComboBox
  130. x:Name="PageRangeComboBox"
  131. Width="326"
  132. Height="32"
  133. Margin="0,10,0,0"
  134. HorizontalAlignment="Left"
  135. IsCurrentPage="True"
  136. Loaded="PageRangeComboBox_Loaded"
  137. MaxPageRange="{Binding MaxPageRange}"
  138. SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}"
  139. Text="{Binding PageRangeText, Mode=TwoWay}">
  140. <i:Interaction.Triggers>
  141. <i:EventTrigger EventName="SelectionChanged">
  142. <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
  143. </i:EventTrigger>
  144. <i:EventTrigger EventName="TextChanged">
  145. <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
  146. </i:EventTrigger>
  147. <i:KeyTrigger Key="Return" FiredOn="KeyDown">
  148. <i:InvokeCommandAction Command="{Binding SetCustomPageRangeCommand}" />
  149. </i:KeyTrigger>
  150. </i:Interaction.Triggers>
  151. </cus:WritableComboBox>
  152. </StackPanel>
  153. </StackPanel>
  154. </StackPanel>
  155. </Grid>
  156. <StackPanel
  157. Grid.ColumnSpan="2"
  158. Height="20"
  159. Margin="0,0,16,8"
  160. HorizontalAlignment="Right"
  161. VerticalAlignment="Bottom"
  162. Panel.ZIndex="2"
  163. Orientation="Horizontal"
  164. Visibility="{Binding LimitationsConvertVisible}">
  165. <Grid Width="16" Height="16">
  166. <Ellipse
  167. Width="13"
  168. Height="13"
  169. Fill="white"
  170. Stroke="#CED0D4" />
  171. <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" />
  172. </Grid>
  173. <TextBlock
  174. Height="20"
  175. Margin="4,0,0,0"
  176. FontFamily="Segoe UI"
  177. FontSize="12"
  178. Foreground="#252629"
  179. Text="First 10 pages for free conversion." />
  180. <TextBlock
  181. Height="20"
  182. Margin="8,0,0,0"
  183. FontFamily="Segoe UI"
  184. FontSize="12"
  185. Foreground="{StaticResource color.light.blue.5}">
  186. <i:Interaction.Triggers>
  187. <i:EventTrigger EventName="MouseDown">
  188. <i:InvokeCommandAction Command="{Binding UnlockMouseDownCommand}" />
  189. </i:EventTrigger>
  190. </i:Interaction.Triggers>
  191. <Underline>
  192. <TextBlock Text="{Binding TextUpgrade}" />
  193. </Underline>
  194. </TextBlock>
  195. </StackPanel>
  196. </Grid>
  197. </cus:DialogContent.Content>
  198. <cus:DialogContent.BottmBar>
  199. <Grid>
  200. <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
  201. <Border>
  202. <TextBlock Text="批量处理" ></TextBlock>
  203. </Border>
  204. </Button>-->
  205. <Button
  206. Width="98"
  207. Height="32"
  208. Margin="0,0,16,0"
  209. HorizontalAlignment="Right"
  210. Command="{Binding CancelCommand}"
  211. Content="{Binding T_No}"
  212. Style="{StaticResource btn.sec}">
  213. <i:Interaction.Triggers>
  214. <i:EventTrigger EventName="PreviewMouseDown">
  215. <i:InvokeCommandAction Command="{Binding PreviewCancelDownCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}" />
  216. </i:EventTrigger>
  217. </i:Interaction.Triggers>
  218. </Button>
  219. <Button
  220. Width="98"
  221. Height="32"
  222. Margin="124,0"
  223. HorizontalAlignment="Right"
  224. Command="{Binding ConverterCommnad}"
  225. Content="{Binding T_YES}"
  226. Style="{StaticResource Btn.cta}" />
  227. </Grid>
  228. </cus:DialogContent.BottmBar>
  229. </cus:DialogContent>
  230. </UserControl>