ConverterExcelDialog.xaml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <UserControl x:Class="PDF_Master.Views.Dialog.ConverterDialogs.ConverterExcelDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  7. xmlns:local="clr-namespace:PDF_Master.Views.Dialog.PageEditDialogs"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pageeditdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.PageEditDialogs"
  10. xmlns:prism="http://prismlibrary.com/"
  11. Width="586"
  12. Height="498"
  13. d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
  14. d:DesignHeight="498"
  15. d:DesignWidth="586"
  16. prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. mc:Ignorable="d">
  19. <cus:DialogContent Header="PDF转Excel">
  20. <cus:DialogContent.Content>
  21. <Grid Grid.Row="1">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="212"/>
  24. <ColumnDefinition Width="*"/>
  25. </Grid.ColumnDefinitions>
  26. <Grid Grid.Column="0">
  27. <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" VerticalAlignment="Top"></cus:PageTurningPreview>
  28. </Grid>
  29. <Grid Grid.Column="1">
  30. <StackPanel Orientation="Vertical" Margin="16,2,0,0">
  31. <StackPanel Orientation="Vertical">
  32. <TextBlock Text="ExcelExcel Workbook Settings" Height="20" Style="{StaticResource PropertyHeaderLv2}"/>
  33. <StackPanel Orientation="Vertical" Margin="0,10,0,0">
  34. <RadioButton Name="AnyContentRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=AnyContentRadioBtn,Path=Name}" IsChecked="True"
  35. Style="{StaticResource RadioButtonStyleText}">
  36. <TextBlock Text="All contents"/>
  37. </RadioButton>
  38. <ComboBox Margin="0,8,0,0" Width="326" Height="32" HorizontalAlignment="Left" IsEnabled="{Binding ElementName=AnyContentRadioBtn,Path=IsChecked}" SelectedIndex="{Binding AnyContentSelectIndex}" >
  39. <ComboBoxItem Content="为每个页面创建工作表 "/>
  40. <ComboBoxItem Content="为文档创建单个工作表"/>
  41. </ComboBox>
  42. <RadioButton Margin="0,8,0,0" Name="OnlyTableRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTableRadioBtn,Path=Name}" Padding="8,0,0,0"
  43. Style="{StaticResource RadioButtonStyleText}">
  44. <TextBlock Text="Only Tables"/>
  45. </RadioButton>
  46. <ComboBox Name="OnlyTableComboBox" Margin="0,8,0,0" Width="326" Height="32" HorizontalAlignment="Left" IsEnabled="{Binding ElementName=OnlyTableRadioBtn,Path=IsChecked}" SelectedIndex="{Binding OnlyTableSelectIndex}">
  47. <ComboBoxItem Content="支持一个表格提取到单独的工作表"/>
  48. <ComboBoxItem Content="支持按页面提取表格到单独的工作表"/>
  49. <ComboBoxItem Content="支持将所有表格提取到一个工作表"/>
  50. </ComboBox>
  51. <RadioButton Margin="0,8,0,0" Name="OnlyTextRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTextRadioBtn,Path=Name}" Padding="8,0,0,0"
  52. Style="{StaticResource RadioButtonStyleText}">
  53. <TextBlock Text="Only Text"></TextBlock>
  54. </RadioButton>
  55. </StackPanel>
  56. </StackPanel>
  57. <StackPanel Orientation="Vertical" Margin="0,18,0,0">
  58. <StackPanel Orientation="Vertical" Visibility="Collapsed">
  59. <TextBlock Text="Text Recognition Settings:" HorizontalAlignment="Left" Height="20" Style="{StaticResource PropertyHeaderLv2}"/>
  60. <CheckBox Name="OCRCheckBox" Margin="0,10,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}" Padding="8,0,0,0" >
  61. <TextBlock Text="Recognize text if needed"/>
  62. </CheckBox>
  63. <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}" Margin="0,8,0,0" Width="326" Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
  64. <ComboBoxItem Content="Chinese Simplified"/>
  65. <ComboBoxItem Content="Chinese Traditional"/>
  66. <ComboBoxItem Content="English"/>
  67. <ComboBoxItem Content="Japan"/>
  68. <ComboBoxItem Content="Korean"/>
  69. </ComboBox>
  70. </StackPanel>
  71. <StackPanel Orientation="Vertical" Margin="0,18,0,0">
  72. <TextBlock Text="Page Range" Height="20" HorizontalAlignment="Left" Style="{StaticResource PropertyHeaderLv2}"/>
  73. <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,10,0,0" Width="326" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
  74. <i:Interaction.Triggers>
  75. <i:EventTrigger EventName="SelectionChanged">
  76. <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
  77. </i:EventTrigger>
  78. <i:EventTrigger EventName="TextChanged">
  79. <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
  80. </i:EventTrigger>
  81. <i:KeyTrigger FiredOn="KeyDown" Key="Return">
  82. <i:InvokeCommandAction Command="{Binding SetCustomPageRangeCommand}" ></i:InvokeCommandAction>
  83. </i:KeyTrigger>
  84. </i:Interaction.Triggers>
  85. </cus:WritableComboBox>
  86. </StackPanel>
  87. </StackPanel>
  88. </StackPanel>
  89. </Grid>
  90. </Grid>
  91. </cus:DialogContent.Content>
  92. <cus:DialogContent.BottmBar>
  93. <Grid>
  94. <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
  95. <Border>
  96. <TextBlock Text="批量处理" ></TextBlock>
  97. </Border>
  98. </Button>-->
  99. <Button
  100. Width="98"
  101. Height="32"
  102. Margin="0,0,16,0"
  103. HorizontalAlignment="Right"
  104. Content="取消"
  105. Command="{Binding CancelCommand}" Style="{StaticResource btn.sec}"/>
  106. <Button
  107. Width="98"
  108. Height="32"
  109. Margin="124,0"
  110. HorizontalAlignment="Right"
  111. Content="转换"
  112. Command = "{Binding ConverterCommnad}" Style="{StaticResource Btn.cta}"/>
  113. </Grid>
  114. </cus:DialogContent.BottmBar>
  115. </cus:DialogContent>
  116. </UserControl>