HomePageConverterDialog.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <UserControl x:Class="PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter.HomePageConverterDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:prism="http://prismlibrary.com/"
  8. prism:ViewModelLocator.AutoWireViewModel="True"
  9. xmlns:convert="clr-namespace:PDF_Master.DataConvert"
  10. d:DesignHeight="600"
  11. d:DesignWidth="818"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <ResourceDictionary>
  15. <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
  16. </ResourceDictionary>
  17. </UserControl.Resources>
  18. <Grid IsEnabled="{Binding ConverterGridIsEnabled}">
  19. <Grid.ColumnDefinitions>
  20. <ColumnDefinition Width="558*"/>
  21. <ColumnDefinition Width="260*" MaxWidth="260"/>
  22. </Grid.ColumnDefinitions>
  23. <Grid Grid.Column="0">
  24. <Grid.RowDefinitions>
  25. <RowDefinition Height="556*"/>
  26. <RowDefinition Height="64*"/>
  27. </Grid.RowDefinitions>
  28. <Grid Grid.Row="0" AllowDrop="True"
  29. Drop="Grid_Drop"
  30. DragEnter="MainPage_DragEnter"
  31. DragOver="MainPage_DragOver"
  32. DragLeave="MainPage_DragLeave"
  33. >
  34. <!--<Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>-->
  35. <Button Name="BtnBlank" Background="Green" Height="300" Width="300" Visibility="{Binding AddFileVisibility}" Command="{Binding ADDPDFCommand}" >
  36. </Button>
  37. <ListView x:Name="listView" DataContext="{Binding PDFDataTable,Mode=TwoWay}" Grid.Row="0" Background="White" ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
  38. <ListView.ContextMenu>
  39. <ContextMenu StaysOpen="True" >
  40. <MenuItem Header="打开文件" Name="OpenFileMenuItem" Click="OpenFileMenuItem_Click"/>
  41. <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
  42. </ContextMenu>
  43. </ListView.ContextMenu>
  44. <ListView.View>
  45. <GridView>
  46. <GridViewColumn Header="文档名" Width="234" DisplayMemberBinding="{Binding FileName}"/>
  47. <GridViewColumn Header="页面范围" Width="156" >
  48. <GridViewColumn.CellTemplate>
  49. <DataTemplate>
  50. <cus:WritableComboBox Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}" EvenPageIsEnabled="{Binding IsEvenPageIsEnabled,Mode=TwoWay}" LostFocus="PageRangeWritableComboBox_LostFocus" MaxPageRange="{Binding MaxPageRange,Mode=TwoWay}" ></cus:WritableComboBox>
  51. </DataTemplate>
  52. </GridViewColumn.CellTemplate>
  53. </GridViewColumn>
  54. <GridViewColumn Header="大小" Width="68" DisplayMemberBinding="{Binding FileSize}"/>
  55. <GridViewColumn Header="状态" Width="80" >
  56. <GridViewColumn.CellTemplate>
  57. <DataTemplate>
  58. <StackPanel Orientation="Horizontal">
  59. <cus:BatchStatus StatusValue="{Binding FileState,Mode=TwoWay}" Width="16" Height="16" MaxStatusValue="{Binding MaxPageRange,Mode=TwoWay}"/>
  60. <Button Name="DeleteTemplateBtn" Width="14" Height="14" Content="X" Foreground="Red" FontSize="8" VerticalAlignment="Center" Margin="38,0,0,0" Click="DeleteTemplateBtn_Click">
  61. </Button>
  62. </StackPanel>
  63. <DataTemplate.Triggers>
  64. <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="True">
  65. <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>
  66. </DataTrigger>
  67. <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="False">
  68. <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Hidden"/>
  69. </DataTrigger>
  70. </DataTemplate.Triggers>
  71. </DataTemplate>
  72. </GridViewColumn.CellTemplate>
  73. </GridViewColumn>
  74. </GridView>
  75. </ListView.View>
  76. <ListView.ItemContainerStyle>
  77. <Style TargetType="ListViewItem">
  78. <Setter Property="Height" Value="42"/>
  79. <Style.Triggers>
  80. <Trigger Property="ListView.AlternationIndex" Value="1">
  81. <Setter Property="Background" Value="LightGray"/>
  82. </Trigger>
  83. </Style.Triggers>
  84. </Style>
  85. </ListView.ItemContainerStyle>
  86. </ListView>
  87. </Grid>
  88. <Grid Grid.Row="1">
  89. <Button x:Name="MenuBtn" Width="113"
  90. Height="40"
  91. Margin="25,0,0,0"
  92. HorizontalAlignment="Left" Click="Menu_Click">
  93. <StackPanel Orientation="Horizontal" >
  94. <Border HorizontalAlignment="Right">
  95. <TextBlock Text="添加文件" FontSize="18" Foreground="Black"></TextBlock>
  96. </Border>
  97. <Border Margin="12,0,0,0">
  98. <Path VerticalAlignment="Center" HorizontalAlignment="Right" Stroke="Black" Data="M0 0L8 4 L16 0" Height="10" Stretch="Fill" />
  99. </Border>
  100. </StackPanel>
  101. </Button>
  102. <Popup x:Name="menuPop1" StaysOpen="False" AllowsTransparency="True" PlacementTarget="{Binding ElementName=MenuBtn}">
  103. <Grid Height="auto" Width="auto" HorizontalAlignment="Left">
  104. <Border BorderThickness="0" CornerRadius="3" Background="White" Margin="3">
  105. <Border.Effect>
  106. <DropShadowEffect ShadowDepth="0" Color="#FFB6B6B6"/>
  107. </Border.Effect>
  108. <StackPanel Margin="0">
  109. <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
  110. <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
  111. <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
  112. </StackPanel>
  113. </Border>
  114. </Grid>
  115. </Popup>
  116. <!--<Button
  117. Width="40"
  118. Height="40"
  119. Margin="0,0,90,0"
  120. HorizontalAlignment="Right">
  121. </Button>-->
  122. <Button
  123. Width="40"
  124. Height="40"
  125. Margin="25,0"
  126. HorizontalAlignment="Right"
  127. IsEnabled="{Binding RemoveIsEnable}"
  128. Command="{Binding RemovePDFFileCommand}"
  129. >
  130. </Button>
  131. </Grid>
  132. </Grid>
  133. <Grid Grid.Column="1" Background="WhiteSmoke" IsEnabled="{Binding SetConverterGridIsEnabled}">
  134. <Grid.RowDefinitions>
  135. <RowDefinition Height="536*"/>
  136. <RowDefinition Height="64*" MaxHeight="64"/>
  137. </Grid.RowDefinitions>
  138. <StackPanel Orientation="Vertical" Margin="15,16,0,0" Grid.Row="0">
  139. <StackPanel Orientation="Vertical">
  140. <TextBlock Text="转档格式"/>
  141. <ComboBox Name="ConverterTypeComboBox" Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" ItemsSource="{Binding ConverterTypeFamily}" SelectedIndex="{Binding ConverterTypeIndex}" SelectionChanged="ConverterTypeComboBox_SelectionChanged">
  142. </ComboBox>
  143. </StackPanel>
  144. <ContentControl Margin="0,18,0,0" x:Name="PrintMod" prism:RegionManager.RegionName="{Binding ConverterRegionName}" Visibility="{Binding ConverterVisible}"/>
  145. <StackPanel Orientation="Vertical" Margin="0,18,0,0" Visibility="{Binding OCRVisibility}">
  146. <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
  147. <CheckBox Name="OCRCheckBox" Margin="0,5,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
  148. <TextBlock Text="在需要时识别文本"/>
  149. </CheckBox>
  150. <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}" Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
  151. <ComboBoxItem Content="Chinese Simplified"/>
  152. <ComboBoxItem Content="Chinese Traditional"/>
  153. <ComboBoxItem Content="English"/>
  154. <ComboBoxItem Content="Japan"/>
  155. <ComboBoxItem Content="Korean"/>
  156. </ComboBox>
  157. </StackPanel>
  158. </StackPanel>
  159. <Grid Grid.Row="2">
  160. <Button Height="32" Width="228" Background="Black" Command="{Binding ConvertCommand}">
  161. <TextBlock Text="转档" FontSize="18" Foreground="White"/>
  162. </Button>
  163. </Grid>
  164. </Grid>
  165. </Grid>
  166. </UserControl>