HomePageBatesDialog.xaml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <UserControl x:Class="PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates.HomePageBatesDialog"
  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 BatesGridIsEnabled}">
  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 x:Name="PageRangeWritableComboBox" Height="24" Width="140" Margin="0,8,0,0" Text="{Binding FilePageRangeText,Mode=TwoWay}" SelectedIndex="{Binding FilePageRangeSelectIndex,Mode=TwoWay}" EvenPageIsEnabled="{Binding IsEvenPageIsEnabled,Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange,Mode=TwoWay}" LostFocus="PageRangeWritableComboBox_LostFocus"></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 SetBatesGridIsEnabled}">
  134. <Grid.RowDefinitions>
  135. <RowDefinition Height="536"/>
  136. <RowDefinition Height="64"/>
  137. </Grid.RowDefinitions>
  138. <Grid Grid.Row="0" Grid.RowSpan="{Binding CreateGridSpan}" Background="#F3F3F3">
  139. <ContentControl prism:RegionManager.RegionName="{Binding BatesSettingsRegionName}" Visibility="{Binding BatesSettingsVisible}" ></ContentControl>
  140. </Grid>
  141. <Grid Grid.Row="1" Visibility="{Binding CreateGridSpanVisibility}">
  142. <Button Height="32" Width="228" Background="#1770F4" Command="{Binding CreateCommand}" IsEnabled="{Binding CreateBtnIsEnabled}">
  143. <TextBlock Text="Apply" FontSize="18" Foreground="White"/>
  144. </Button>
  145. </Grid>
  146. </Grid>
  147. </Grid>
  148. </UserControl>