FileGridListControl.xaml 6.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <UserControl x:Class="ComPDFKit.Controls.PDFControl.FileGridListControl"
  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:pdfControl="clr-namespace:ComPDFKit.Controls.PDFControl"
  8. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  9. mc:Ignorable="d"
  10. Height="390" Width="646">
  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 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="AddFiles_Click"></Button>
  35. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
  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}"></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" MouseLeftButtonDown="FileDataGrid_OnMouseLeftButtonDown" SelectionChanged="FileDataGrid_SelectionChanged">
  50. <DataGrid.Columns>
  51. <DataGridTextColumn Width="*" Binding="{Binding FileName}" >
  52. <DataGridTextColumn.Header>
  53. <TextBlock Text="{Binding Converter={StaticResource SecurityResourceConverter},ConverterParameter=Table_FileName}"/>
  54. </DataGridTextColumn.Header>
  55. </DataGridTextColumn>
  56. <DataGridTextColumn Width="*" Binding="{Binding Size}">
  57. <DataGridTextColumn.Header>
  58. <TextBlock Text="{Binding Converter={StaticResource SecurityResourceConverter},ConverterParameter=Table_FileSize}"/>
  59. </DataGridTextColumn.Header>
  60. </DataGridTextColumn>
  61. <DataGridTextColumn Width="*" Binding="{Binding Location}">
  62. <DataGridTextColumn.Header>
  63. <TextBlock Text="{Binding Converter={StaticResource SecurityResourceConverter},ConverterParameter=Table_Path}"/>
  64. </DataGridTextColumn.Header>
  65. </DataGridTextColumn>
  66. </DataGrid.Columns>
  67. <DataGrid.Resources>
  68. <Style TargetType="DataGrid">
  69. <Setter Property="HorizontalGridLinesBrush" Value="#E6E6E6" />
  70. <Setter Property="VerticalGridLinesBrush" Value="#E6E6E6" />
  71. </Style>
  72. <Style TargetType="DataGridColumnHeader">
  73. <Setter Property="Foreground" Value="#666666" />
  74. <Setter Property="FontFamily" Value="Microsoft YaHei" />
  75. <Setter Property="FontSize" Value="12" />
  76. </Style>
  77. <Style TargetType="DataGridCell">
  78. <Setter Property="FontFamily" Value="Microsoft YaHei" />
  79. <Setter Property="FontSize" Value="12" />
  80. <Setter Property="Foreground" Value="#666666" />
  81. <Setter Property="BorderThickness" Value="0"></Setter>
  82. <Style.Triggers>
  83. <Trigger Property="IsSelected" Value="True">
  84. <Setter Property="Background" Value="#0078D7" />
  85. <Setter Property="Foreground" Value="White" />
  86. </Trigger>
  87. </Style.Triggers>
  88. </Style>
  89. </DataGrid.Resources>
  90. </DataGrid>
  91. </Grid>
  92. <Button Grid.Row="1" x:Name="BtnRemove" FontFamily="Microsoft YaHei" FontSize="14" Content="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Button_RemoveAll}" MinWidth="112" Padding="5,0,5,0" Height="32" HorizontalAlignment="Left" Click="Remove_Click"></Button>
  93. </Grid>
  94. </Border>
  95. </Grid>
  96. </UserControl>