ConverterExcelDialog.xaml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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="{Binding T_Title}">
  20. <cus:DialogContent.Content>
  21. <Grid Grid.Row="1">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="244"/>
  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="0,2,0,0">
  31. <StackPanel Orientation="Vertical">
  32. <TextBlock Text="{Binding T_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="{Binding T_AllContents}"/>
  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="{Binding T_EachPageAllContents}"/>
  40. <ComboBoxItem Content="{Binding T_FileAllContents}"/>
  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="{Binding T_OnlyTables}"/>
  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="{Binding T_EachTableOnlyTables}"/>
  48. <ComboBoxItem Content="{Binding T_EachPageOnlyTables}"/>
  49. <ComboBoxItem Content="{Binding T_FileOnlyTables}"/>
  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="{Binding T_OnlyText}"></TextBlock>
  54. </RadioButton>
  55. </StackPanel>
  56. </StackPanel>
  57. <StackPanel Orientation="Vertical" Margin="0,18,0,0">
  58. <StackPanel Orientation="Vertical" Visibility="Visible" IsEnabled="{Binding OCRIsEnable}">
  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="Japanese"/>
  68. <ComboBoxItem Content="Korean"/>
  69. </ComboBox>
  70. </StackPanel>
  71. <StackPanel Orientation="Vertical" Margin="0,18,0,0">
  72. <TextBlock Text="{Binding T_PageRange}" 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="{Binding T_No}"
  105. Command="{Binding CancelCommand}" Style="{StaticResource btn.sec}">
  106. <i:Interaction.Triggers>
  107. <i:EventTrigger EventName="PreviewMouseDown">
  108. <i:InvokeCommandAction Command="{Binding PreviewCancelDownCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}" />
  109. </i:EventTrigger>
  110. </i:Interaction.Triggers>
  111. </Button>
  112. <Button
  113. Width="98"
  114. Height="32"
  115. Margin="124,0"
  116. HorizontalAlignment="Right"
  117. Content="{Binding T_YES}"
  118. Command = "{Binding ConverterCommnad}" Style="{StaticResource Btn.cta}"/>
  119. </Grid>
  120. </cus:DialogContent.BottmBar>
  121. </cus:DialogContent>
  122. </UserControl>