HomePageWatermarkDialog.xaml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark.HomePageWatermarkDialog"
  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:cus="clr-namespace:PDF_Office.CustomControl"
  7. xmlns:prism="http://prismlibrary.com/"
  8. prism:ViewModelLocator.AutoWireViewModel="True"
  9. xmlns:convert="clr-namespace:PDF_Office.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 WatermarkGridIsEnabled}">
  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"></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. <TextBlock Text="{Binding FileState}" Width="14" Height="14" TextDecorations="Underline" Foreground="Black"/>
  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. </StackPanel>
  112. </Border>
  113. </Grid>
  114. </Popup>
  115. <Button
  116. Width="40"
  117. Height="40"
  118. Margin="0,0,90,0"
  119. HorizontalAlignment="Right">
  120. </Button>
  121. <Button
  122. Width="40"
  123. Height="40"
  124. Margin="25,0"
  125. HorizontalAlignment="Right"
  126. IsEnabled="{Binding RemoveIsEnable}"
  127. Command="{Binding RemovePDFFileCommand}"
  128. >
  129. </Button>
  130. </Grid>
  131. </Grid>
  132. <Grid Grid.Column="1" Background="WhiteSmoke" IsEnabled="{Binding SetWatermarkGridIsEnabled}">
  133. <Grid.RowDefinitions>
  134. <RowDefinition Height="536"/>
  135. <RowDefinition Height="64"/>
  136. </Grid.RowDefinitions>
  137. <Grid Grid.Row="0" Grid.RowSpan="{Binding CreateGridSpan}" Background="#F3F3F3">
  138. <ContentControl prism:RegionManager.RegionName="{Binding WatermarkSettingsRegionName}" Visibility="{Binding WatermarkSettingsVisible}"></ContentControl>
  139. </Grid>
  140. <Grid Grid.Row="1" Visibility="{Binding CreateGridSpanVisibility}">
  141. <Button Height="32" Width="228" Background="Black" Command="{Binding CreateCommand}">
  142. <TextBlock Text="Apply" FontSize="18" Foreground="White"/>
  143. </Button>
  144. </Grid>
  145. </Grid>
  146. </Grid>
  147. </UserControl>