FileGridListWithPageRangeControl.xaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <UserControl x:Class="ComPDFKit.Controls.PDFControl.FileGridListWithPageRangeControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:ComPDFKit.Controls.PDFControl"
  7. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  8. Loaded="UserControl_Loaded"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="500">
  11. <UserControl.Resources>
  12. <ResourceDictionary>
  13. <common:SecurityResourceConverter x:Key="SecurityResourceConverter"/>
  14. <Style x:Key="CustomDataGridStyle" TargetType="DataGrid">
  15. <Setter Property="BorderBrush" Value="#E6E6E6" />
  16. <Setter Property="BorderThickness" Value="1" />
  17. <Setter Property="CellStyle">
  18. <Setter.Value>
  19. <Style TargetType="DataGridCell">
  20. <Setter Property="BorderThickness" Value="1" />
  21. <Setter Property="BorderBrush" Value="#E6E6E6" />
  22. </Style>
  23. </Setter.Value>
  24. </Setter>
  25. </Style>
  26. </ResourceDictionary>
  27. </UserControl.Resources>
  28. <Grid Margin="10,0,10,0">
  29. <Grid.RowDefinitions>
  30. <RowDefinition Height="50"></RowDefinition>
  31. <RowDefinition Height="*"></RowDefinition>
  32. </Grid.RowDefinitions>
  33. <DockPanel Grid.Row="0" Grid.Column="0">
  34. <Button x:Name="AddFilesBtn" Content="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Button_AddFiles}" Height="32" MinWidth="112" FontFamily="Microsoft YaHei" FontSize="14" Padding="28,6,27,6" HorizontalAlignment="Left" Click="AddFilesBtn_Click"></Button>
  35. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0">
  36. <TextBlock Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Text_FileCount}" FontFamily="Microsoft YaHei" FontSize="14"></TextBlock>
  37. <TextBlock FontFamily="Microsoft YaHei" FontSize="14" Text="{Binding FileNumText}" Margin="5,0,0,0"></TextBlock>
  38. </StackPanel>
  39. </DockPanel>
  40. <Border Grid.Row="1" Grid.Column="0" BorderBrush="#CCCCCC" BorderThickness="1">
  41. <Grid Margin="10,10,10,0">
  42. <Grid.RowDefinitions>
  43. <RowDefinition Height="*"></RowDefinition>
  44. <RowDefinition Height="50"></RowDefinition>
  45. </Grid.RowDefinitions>
  46. <Grid Grid.Row="0" VerticalAlignment="Stretch">
  47. <DataGrid Background="White" BorderBrush="#E6E6E6" x:Name="FileDataGrid" HeadersVisibility="Column"
  48. IsReadOnly="True" AutoGenerateColumns="False" FontSize="14" SelectionMode="Extended"
  49. ScrollViewer.CanContentScroll="False" HorizontalScrollBarVisibility="Auto" SelectionChanged="FileDataGrid_SelectionChanged"
  50. MouseLeftButtonDown="FileDataGrid_MouseLeftButtonDown">
  51. <DataGrid.Columns>
  52. <DataGridTextColumn Width="*" Binding="{Binding Name}" >
  53. <DataGridTextColumn.Header>
  54. <TextBlock Text="{Binding Converter={StaticResource SecurityResourceConverter},ConverterParameter=Table_FileName}"/>
  55. </DataGridTextColumn.Header>
  56. </DataGridTextColumn>
  57. <DataGridTextColumn Width="*" Binding="{Binding Size}">
  58. <DataGridTextColumn.Header>
  59. <TextBlock Text="{Binding Converter={StaticResource SecurityResourceConverter},ConverterParameter=Table_FileSize}"/>
  60. </DataGridTextColumn.Header>
  61. </DataGridTextColumn>
  62. <DataGridTextColumn Width="*" Binding="{Binding PageRange}">
  63. <DataGridTextColumn.Header>
  64. <TextBlock Text="{Binding Converter={StaticResource SecurityResourceConverter},ConverterParameter=Table_PageRange}"/>
  65. </DataGridTextColumn.Header>
  66. </DataGridTextColumn>
  67. <DataGridTextColumn Width="*" Binding="{Binding Path}">
  68. <DataGridTextColumn.Header>
  69. <TextBlock Text="{Binding Converter={StaticResource SecurityResourceConverter},ConverterParameter=Table_Path}"/>
  70. </DataGridTextColumn.Header>
  71. </DataGridTextColumn>
  72. </DataGrid.Columns>
  73. <DataGrid.Resources>
  74. <Style TargetType="DataGrid">
  75. <Setter Property="HorizontalGridLinesBrush" Value="#E6E6E6" />
  76. <Setter Property="VerticalGridLinesBrush" Value="#E6E6E6" />
  77. </Style>
  78. <Style TargetType="DataGridColumnHeader">
  79. <Setter Property="Foreground" Value="#666666" />
  80. <Setter Property="FontFamily" Value="Microsoft YaHei" />
  81. <Setter Property="FontSize" Value="12" />
  82. </Style>
  83. <Style TargetType="DataGridCell">
  84. <Setter Property="FontFamily" Value="Microsoft YaHei" />
  85. <Setter Property="FontSize" Value="12" />
  86. <Setter Property="Foreground" Value="#666666" />
  87. <Setter Property="BorderThickness" Value="0"></Setter>
  88. <Style.Triggers>
  89. <Trigger Property="IsSelected" Value="True">
  90. <Setter Property="Background" Value="#0078D7" />
  91. <Setter Property="Foreground" Value="White" />
  92. </Trigger>
  93. </Style.Triggers>
  94. </Style>
  95. </DataGrid.Resources>
  96. </DataGrid>
  97. </Grid>
  98. <StackPanel Grid.Row="1" Orientation="Horizontal">
  99. <Button x:Name="RemoveBtn" FontFamily="Microsoft YaHei" FontSize="14" Content="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Button_RemoveAll}" MinWidth="112" Height="32" HorizontalAlignment="Left" Padding="5,0,5,0" Click="RemoveBtn_Click"></Button>
  100. <Button x:Name="PageRangeBtn" FontFamily="Microsoft YaHei" FontSize="14" Content="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Text_PageRange}" MinWidth="112" Height="32" HorizontalAlignment="Left" Margin="20,0,0,0" Padding="5,0,5,0" Visibility="Collapsed" Click="PageRangeBtn_Click"></Button>
  101. </StackPanel>
  102. </Grid>
  103. </Border>
  104. </Grid>
  105. </UserControl>