ConverterExcelDialog.xaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <UserControl x:Class="PDF_Office.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_Office.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_Office.Views.Dialog.PageEditDialogs"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
  10. xmlns:prism="http://prismlibrary.com/"
  11. Width="529"
  12. Height="482"
  13. d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
  14. d:DesignHeight="482"
  15. d:DesignWidth="529"
  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"></cus:PageTurningPreview>
  28. </Grid>
  29. <Grid Grid.Column="1">
  30. <StackPanel Orientation="Vertical" Margin="18,16,0,0">
  31. <StackPanel Orientation="Vertical">
  32. <TextBlock Text="Excel工作簿设置:" Height="20"/>
  33. <StackPanel Orientation="Vertical" Margin="0,7,0,0">
  34. <RadioButton Name="AnyContentRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=AnyContentRadioBtn,Path=Name}" IsChecked="True">
  35. <TextBlock Text="所有内容"/>
  36. </RadioButton>
  37. <ComboBox Margin="0,8,0,0" Width="228" Height="28.55" IsEnabled="{Binding ElementName=AnyContentRadioBtn,Path=IsChecked}" SelectedIndex="{Binding AnyContentSelectIndex}">
  38. <ComboBoxItem Content="为每个页面创建工作表 "/>
  39. <ComboBoxItem Content="为文档创建单个工作表"/>
  40. </ComboBox>
  41. <RadioButton Margin="0,10,0,0" Name="OnlyTableRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTableRadioBtn,Path=Name}">
  42. <TextBlock Text="只提取表格"/>
  43. </RadioButton>
  44. <ComboBox Name="OnlyTableComboBox" Margin="0,8,0,0" Width="228" Height="28.55" IsEnabled="{Binding ElementName=OnlyTableRadioBtn,Path=IsChecked}" SelectedIndex="{Binding OnlyTableSelectIndex}">
  45. <ComboBoxItem Content="支持一个表格提取到单独的工作表"/>
  46. <ComboBoxItem Content="支持按页面提取表格到单独的工作表"/>
  47. <ComboBoxItem Content="支持将所有表格提取到一个工作表"/>
  48. </ComboBox>
  49. <RadioButton Margin="0,10,0,0" Name="OnlyTextRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTextRadioBtn,Path=Name}">
  50. <TextBlock Text="只提取文字"></TextBlock>
  51. </RadioButton>
  52. </StackPanel>
  53. </StackPanel>
  54. <StackPanel Orientation="Vertical" Margin="0,16,0,0">
  55. <StackPanel Orientation="Vertical">
  56. <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
  57. <CheckBox Name="OCRCheckBox" Margin="0,5,0,0">
  58. <TextBlock Text="在需要时识别文本"/>
  59. </CheckBox>
  60. <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}" Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left">
  61. </ComboBox>
  62. </StackPanel>
  63. <StackPanel Orientation="Vertical" Margin="0,14,0,0">
  64. <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
  65. <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
  66. <i:Interaction.Triggers>
  67. <i:EventTrigger EventName="SelectionChanged">
  68. <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
  69. </i:EventTrigger>
  70. <i:EventTrigger EventName="TextChanged">
  71. <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
  72. </i:EventTrigger>
  73. </i:Interaction.Triggers>
  74. </cus:WritableComboBox>
  75. </StackPanel>
  76. </StackPanel>
  77. </StackPanel>
  78. </Grid>
  79. </Grid>
  80. </cus:DialogContent.Content>
  81. <cus:DialogContent.BottmBar>
  82. <Grid>
  83. <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}">
  84. <Border>
  85. <TextBlock Text="批量处理" ></TextBlock>
  86. </Border>
  87. </Button>
  88. <Button
  89. Width="98"
  90. Height="32"
  91. Margin="0,0,124,0"
  92. HorizontalAlignment="Right"
  93. Content="取消"
  94. Command="{Binding CancelCommand}"/>
  95. <Button
  96. Width="98"
  97. Height="32"
  98. Margin="16,0"
  99. HorizontalAlignment="Right"
  100. Content="转换"
  101. Command = "{Binding ConverterCommnad}"/>
  102. </Grid>
  103. </cus:DialogContent.BottmBar>
  104. </cus:DialogContent>
  105. </UserControl>