HomePageCompressDialog.xaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageCompressDialog"
  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. prism:ViewModelLocator.AutoWireViewModel="True"
  8. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  9. d:DesignHeight="600"
  10. d:DesignWidth="818"
  11. mc:Ignorable="d">
  12. <UserControl.Resources>
  13. <ResourceDictionary>
  14. <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
  15. </ResourceDictionary>
  16. </UserControl.Resources>
  17. <Grid IsEnabled="{Binding CompressGridIsEnabled}">
  18. <Grid.ColumnDefinitions>
  19. <ColumnDefinition Width="558*"/>
  20. <ColumnDefinition Width="260*" MaxWidth="260"/>
  21. </Grid.ColumnDefinitions>
  22. <Grid Grid.Column="0">
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="556*"/>
  25. <RowDefinition Height="64*"/>
  26. </Grid.RowDefinitions>
  27. <Grid Grid.Row="0" AllowDrop="True"
  28. Drop="Grid_Drop"
  29. DragEnter="MainPage_DragEnter"
  30. DragOver="MainPage_DragOver"
  31. DragLeave="MainPage_DragLeave"
  32. >
  33. <Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>
  34. <Button Name="BtnBlank" Background="Green" Height="300" Width="300" Visibility="{Binding AddFileVisibility}" Command="{Binding ADDPDFCommand}" >
  35. </Button>
  36. <ListView x:Name="listView" DataContext="{Binding PDFDataTable,Mode=TwoWay}" Background="White" ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
  37. <ListView.ContextMenu>
  38. <ContextMenu StaysOpen="True" >
  39. <MenuItem Header="打开文件" Name="OpenFileMenuItem" Click="OpenFileMenuItem_Click"/>
  40. <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
  41. </ContextMenu>
  42. </ListView.ContextMenu>
  43. <ListView.View>
  44. <GridView>
  45. <GridViewColumn Header="文档名" Width="390" DisplayMemberBinding="{Binding FileName}"/>
  46. <GridViewColumn Header="大小" Width="68" DisplayMemberBinding="{Binding FileSize}"/>
  47. <GridViewColumn Header="状态" Width="80" >
  48. <GridViewColumn.CellTemplate>
  49. <DataTemplate>
  50. <StackPanel Orientation="Horizontal">
  51. <TextBlock Text="{Binding FileState}" Width="14" Height="14" TextDecorations="Underline" Foreground="Black"/>
  52. <Button Name="DeleteTemplateBtn" Width="14" Height="14" Content="X" Foreground="Red" FontSize="8" VerticalAlignment="Center" Margin="38,0,0,0" Click="DeleteTemplateBtn_Click">
  53. </Button>
  54. </StackPanel>
  55. <DataTemplate.Triggers>
  56. <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="True">
  57. <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>
  58. </DataTrigger>
  59. <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="False">
  60. <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Hidden"/>
  61. </DataTrigger>
  62. </DataTemplate.Triggers>
  63. </DataTemplate>
  64. </GridViewColumn.CellTemplate>
  65. </GridViewColumn>
  66. </GridView>
  67. </ListView.View>
  68. <ListView.ItemContainerStyle>
  69. <Style TargetType="ListViewItem">
  70. <Setter Property="Height" Value="42"/>
  71. <Style.Triggers>
  72. <Trigger Property="ListView.AlternationIndex" Value="1">
  73. <Setter Property="Background" Value="LightGray"/>
  74. </Trigger>
  75. </Style.Triggers>
  76. </Style>
  77. </ListView.ItemContainerStyle>
  78. </ListView>
  79. </Grid>
  80. <Grid Grid.Row="1">
  81. <Button x:Name="MenuBtn" Width="113"
  82. Height="40"
  83. Margin="25,0,0,0"
  84. HorizontalAlignment="Left" Click="Menu_Click">
  85. <StackPanel Orientation="Horizontal" >
  86. <Border HorizontalAlignment="Right">
  87. <TextBlock Text="添加文件" FontSize="18" Foreground="Black"></TextBlock>
  88. </Border>
  89. <Border Margin="12,0,0,0">
  90. <Path VerticalAlignment="Center" HorizontalAlignment="Right" Stroke="Black" Data="M0 0L8 4 L16 0" Height="10" Stretch="Fill" />
  91. </Border>
  92. </StackPanel>
  93. </Button>
  94. <Popup x:Name="menuPop1" StaysOpen="False" AllowsTransparency="True" PlacementTarget="{Binding ElementName=MenuBtn}">
  95. <Grid Height="auto" Width="auto" HorizontalAlignment="Left">
  96. <Border BorderThickness="0" CornerRadius="3" Background="White" Margin="3">
  97. <Border.Effect>
  98. <DropShadowEffect ShadowDepth="0" Color="#FFB6B6B6"/>
  99. </Border.Effect>
  100. <StackPanel Margin="0">
  101. <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
  102. <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
  103. </StackPanel>
  104. </Border>
  105. </Grid>
  106. </Popup>
  107. <Button
  108. Width="40"
  109. Height="40"
  110. Margin="0,0,90,0"
  111. HorizontalAlignment="Right">
  112. </Button>
  113. <Button
  114. Width="40"
  115. Height="40"
  116. Margin="25,0"
  117. HorizontalAlignment="Right"
  118. IsEnabled="{Binding RemoveIsEnable}"
  119. Command="{Binding RemovePDFFileCommand}"
  120. >
  121. </Button>
  122. </Grid>
  123. </Grid>
  124. <Grid Grid.Column="1" Background="WhiteSmoke" IsEnabled="{Binding SetCompressGridIsEnabled}">
  125. <Grid.RowDefinitions>
  126. <RowDefinition Height="536*"/>
  127. <RowDefinition Height="64*" MaxHeight="64"/>
  128. </Grid.RowDefinitions>
  129. <StackPanel Orientation="Vertical" Margin="16,14,0,0" Grid.Row="0">
  130. <TextBlock Text="优化选项" FontSize="14" Width="228" Height=" 22" FontFamily="Segoe UI" TextBlock.Foreground="#252629" HorizontalAlignment="Left"/>
  131. <TextBlock Text="Optimization Options" FontSize="12" FontFamily="Segoe UI" Width="228" Height=" 20" TextBlock.Foreground="#616469" Margin="0,16,0,0" HorizontalAlignment="Left"/>
  132. <RadioButton Name="LargeQualityRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=LargeQualityRadioBtn,Path=Name}" Margin="0,10,0,0">
  133. <TextBlock Text="大型文件" FontSize="14" Height="22" Width="87" TextBlock.Foreground="#252629"/>
  134. </RadioButton>
  135. <RadioButton Name="StandardQualityRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=StandardQualityRadioBtn,Path=Name}" Margin="0,8,0,0">
  136. <TextBlock Text="标准文件" FontSize="14" Height="22" Width="87" TextBlock.Foreground="#252629"/>
  137. </RadioButton>
  138. <RadioButton Name="LittleQualityRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=LittleQualityRadioBtn,Path=Name}" Margin="0,8,0,0" IsChecked="True">
  139. <TextBlock Text="小型文件" FontSize="14" Height="22" Width="87" TextBlock.Foreground="#252629"/>
  140. </RadioButton>
  141. <RadioButton Name="MicroQualityRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=MicroQualityRadioBtn,Path=Name}" Margin="0,8,0,0">
  142. <TextBlock Text="微型文件" FontSize="14" Height="22" Width="87" TextBlock.Foreground="#252629"/>
  143. </RadioButton>
  144. </StackPanel>
  145. <Grid Grid.Row="2">
  146. <Button Height="32" Width="228" Background="Black" Command="{Binding CompressCommand}">
  147. <TextBlock Text="压缩" FontSize="18" Foreground="White"/>
  148. </Button>
  149. </Grid>
  150. </Grid>
  151. </Grid>
  152. </UserControl>