HomePagePictureToPDFDialog.xaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePictureToPDFDialog"
  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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:prism="http://prismlibrary.com/"
  7. xmlns:homepagetoolsdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.HomePageToolsDialogs"
  8. d:DataContext="{d:DesignInstance Type=homepagetoolsdialogs:HomePagePictureToPDFDialogViewModel}"
  9. prism:ViewModelLocator.AutoWireViewModel="True"
  10. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  11. d:DesignHeight="554"
  12. d:DesignWidth="892"
  13. mc:Ignorable="d">
  14. <UserControl.Resources>
  15. <ResourceDictionary>
  16. <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
  17. </ResourceDictionary>
  18. </UserControl.Resources>
  19. <Grid IsEnabled="{Binding PictureToPDFGridIsEnabled}">
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="632"/>
  22. <ColumnDefinition Width="260"/>
  23. </Grid.ColumnDefinitions>
  24. <Grid Grid.Column="0">
  25. <Grid.RowDefinitions>
  26. <RowDefinition Height="482"/>
  27. <RowDefinition Height="72"/>
  28. </Grid.RowDefinitions>
  29. <Grid Grid.Row="0" AllowDrop="True"
  30. Drop="Grid_Drop"
  31. DragEnter="MainPage_DragEnter"
  32. DragOver="MainPage_DragOver"
  33. DragLeave="MainPage_DragLeave"
  34. >
  35. <Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>
  36. <Button Name="BtnBlank" Background="Green" Height="400" Width="400" Visibility="{Binding AddFileVisibility}" Command="{Binding ADDPictureCommand}">
  37. </Button>
  38. <ListView x:Name="listView" DataContext="{Binding ImagesDataTable}" Background="White" ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
  39. <ListView.ContextMenu>
  40. <ContextMenu StaysOpen="True" >
  41. <MenuItem Header="打开文件" Name="OpenFileMenuItem" Click="OpenFileMenuItem_Click"/>
  42. <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
  43. </ContextMenu>
  44. </ListView.ContextMenu>
  45. <ListView.View>
  46. <GridView>
  47. <GridViewColumn Header="文档名" Width="400" DisplayMemberBinding="{Binding FileName}"/>
  48. <GridViewColumn Header="大小" Width="100" DisplayMemberBinding="{Binding FileSize}"/>
  49. <GridViewColumn Header="状态" Width="80" >
  50. <GridViewColumn.CellTemplate>
  51. <DataTemplate>
  52. <StackPanel Orientation="Horizontal">
  53. <TextBlock Text="{Binding FileState}" Width="14" Height="14" TextDecorations="Underline" Foreground="Black"/>
  54. <Button Name="DeleteTemplateBtn" Width="14" Height="14" Content="X" Foreground="Red" FontSize="8" VerticalAlignment="Center" Margin="38,0,0,0" Click="DeleteTemplateBtn_Click">
  55. </Button>
  56. </StackPanel>
  57. <DataTemplate.Triggers>
  58. <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="True">
  59. <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>
  60. </DataTrigger>
  61. <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="False">
  62. <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Hidden"/>
  63. </DataTrigger>
  64. </DataTemplate.Triggers>
  65. </DataTemplate>
  66. </GridViewColumn.CellTemplate>
  67. </GridViewColumn>
  68. </GridView>
  69. </ListView.View>
  70. <ListView.ItemContainerStyle>
  71. <Style TargetType="ListViewItem">
  72. <Setter Property="Height" Value="42"/>
  73. <Style.Triggers>
  74. <Trigger Property="ListView.AlternationIndex" Value="1">
  75. <Setter Property="Background" Value="LightGray"/>
  76. </Trigger>
  77. </Style.Triggers>
  78. </Style>
  79. </ListView.ItemContainerStyle>
  80. </ListView>
  81. </Grid>
  82. <Grid Grid.Row="1">
  83. <Button x:Name="MenuBtn" Width="113"
  84. Height="40"
  85. Margin="25,0,0,0"
  86. HorizontalAlignment="Left" Click="Menu_Click">
  87. <StackPanel Orientation="Horizontal" >
  88. <Border HorizontalAlignment="Right">
  89. <TextBlock Text="添加文件" FontSize="18" Foreground="Black"></TextBlock>
  90. </Border>
  91. <Border Margin="12,0,0,0">
  92. <Path VerticalAlignment="Center" HorizontalAlignment="Right" Stroke="Black" Data="M0 0L8 4 L16 0" Height="10" Stretch="Fill" />
  93. </Border>
  94. </StackPanel>
  95. </Button>
  96. <Popup x:Name="menuPop1" StaysOpen="False" AllowsTransparency="True" PlacementTarget="{Binding ElementName=MenuBtn}">
  97. <Grid Height="auto" Width="auto" HorizontalAlignment="Left">
  98. <Border BorderThickness="0" CornerRadius="3" Background="White" Margin="3">
  99. <Border.Effect>
  100. <DropShadowEffect ShadowDepth="0" Color="#FFB6B6B6"/>
  101. </Border.Effect>
  102. <StackPanel Margin="0">
  103. <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPictureCommand}"></MenuItem>
  104. <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPictureFilesCommand}"></MenuItem>
  105. </StackPanel>
  106. </Border>
  107. </Grid>
  108. </Popup>
  109. <Button
  110. Width="40"
  111. Height="40"
  112. Margin="0,0,90,0"
  113. HorizontalAlignment="Right">
  114. </Button>
  115. <Button
  116. Width="40"
  117. Height="40"
  118. Margin="25,0"
  119. HorizontalAlignment="Right"
  120. IsEnabled="{Binding RemoveIsEnable}"
  121. Command="{Binding RemovePictureFileCommand}">
  122. </Button>
  123. </Grid>
  124. </Grid>
  125. <Grid Grid.Column="1" Background="WhiteSmoke" IsEnabled="{Binding SetPictureToPDFGridIsEnabled}">
  126. <Grid.RowDefinitions>
  127. <RowDefinition Height="*"/>
  128. <RowDefinition Height="2*"/>
  129. <RowDefinition Height="72"/>
  130. </Grid.RowDefinitions>
  131. <Grid Grid.Row="0">
  132. <StackPanel Margin="15,23,0,0">
  133. <TextBlock Text="导出"/>
  134. <StackPanel Margin="0,8,0,0">
  135. <RadioButton Name="NewFilesRadioButtom" Click="RadioButton_Click" IsChecked="True">
  136. <TextBlock Text="新建文档"/>
  137. </RadioButton>
  138. <RadioButton Name="OneNewFileNameRadioButtom" Margin="0,8,0,0" Click="RadioButton_Click">
  139. <TextBlock Text="合并为同一份PDF文档"/>
  140. </RadioButton>
  141. <RadioButton Name="SelectFileNameRadioButton" Margin="0,8,0,0" Click="RadioButton_Click">
  142. <TextBlock Text="插入现有PDF文档"/>
  143. </RadioButton>
  144. </StackPanel>
  145. <StackPanel Orientation="Horizontal" Margin="0,4,0,0">
  146. <TextBox IsEnabled="False" Text="{Binding SelectFileName}" VerticalContentAlignment="Center" Height="32" Width="190"/>
  147. <Button Width="32" Command="{Binding SelectFileCommand}" IsEnabled="{Binding ElementName=SelectFileNameRadioButton,Path=IsChecked}">
  148. </Button>
  149. </StackPanel>
  150. </StackPanel>
  151. </Grid>
  152. <Grid Grid.Row="1">
  153. <StackPanel Margin="15,0,0,0">
  154. <TextBlock Text="OCR"/>
  155. <CheckBox Name="NeedOCRCheckBox" Margin="0,7,0,0">
  156. <TextBlock Text="在需要时识别文本"/>
  157. </CheckBox>
  158. <ComboBox Height="28.55" Width="228" HorizontalAlignment="Left" Margin="0,4,0,0" IsEnabled="{Binding ElementName=NeedOCRCheckBox,Path=IsChecked}"></ComboBox>
  159. <CheckBox Margin="0,16,0,0" IsEnabled="{Binding ElementName=NeedOCRCheckBox,Path=IsChecked}">
  160. <TextBlock Text="识别为TXT"/>
  161. </CheckBox>
  162. </StackPanel>
  163. </Grid>
  164. <Grid Grid.Row="2">
  165. <Button Height="40" Width="228" Background="Black" Command="{Binding ToPDFCommand}">
  166. <TextBlock Text="导出文档" FontSize="18" Foreground="White"/>
  167. </Button>
  168. </Grid>
  169. </Grid>
  170. </Grid>
  171. </UserControl>