HomePageControl.xaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <UserControl x:Class="ComPDFKit.Controls.PDFControl.HomePageControl"
  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. mc:Ignorable="d"
  8. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  9. d:DesignHeight="800" d:DesignWidth="1920"
  10. Loaded="UserControl_Loaded"
  11. Unloaded="UserControl_Unloaded" x:Name="HomePage">
  12. <UserControl.Resources>
  13. <DrawingImage x:Key="OpenDocumentIcon">
  14. <DrawingImage.Drawing>
  15. <DrawingGroup>
  16. <GeometryDrawing Brush="#FFFFFFFF">
  17. <GeometryDrawing.Geometry>
  18. <PathGeometry FillRule="EvenOdd" Figures="M19.8341,0L2,0 2,30 28,30 28,8.2809 19.8341,0z M18,2L18,10 26,10 18,2z M16,14L16,19 21,19 21,21 16,21 16,26 14,26 14,21 9,21 9,19 14,19 14,14 16,14z" />
  19. </GeometryDrawing.Geometry>
  20. </GeometryDrawing>
  21. </DrawingGroup>
  22. </DrawingImage.Drawing>
  23. </DrawingImage>
  24. <DrawingImage x:Key="CreateDocumentIcon">
  25. <DrawingImage.Drawing>
  26. <DrawingGroup>
  27. <GeometryDrawing Brush="#FF001A4E">
  28. <GeometryDrawing.Geometry>
  29. <PathGeometry FillRule="EvenOdd" Figures="M20.3341,0L2.5,0 2.5,30 28.5,30 28.5,8.2809 20.3341,0z M18.5,2L18.5,10 26.5,10 18.5,2z M16.5,14L16.5,19 21.5,19 21.5,21 16.5,21 16.5,26 14.5,26 14.5,21 9.5,21 9.5,19 14.5,19 14.5,14 16.5,14z" />
  30. </GeometryDrawing.Geometry>
  31. </GeometryDrawing>
  32. </DrawingGroup>
  33. </DrawingImage.Drawing>
  34. </DrawingImage>
  35. <Style x:Key="ButtonHoverStyle" TargetType="Button">
  36. <Setter Property="Template">
  37. <Setter.Value>
  38. <ControlTemplate TargetType="Button">
  39. <Grid x:Name="grid" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
  40. <Border Name="border" Background="Transparent" BorderThickness="1" BorderBrush="#001A4E">
  41. <ContentPresenter
  42. HorizontalAlignment="Center"
  43. VerticalAlignment="Center"
  44. Focusable="False"
  45. RecognizesAccessKey="True">
  46. </ContentPresenter>
  47. </Border>
  48. </Grid>
  49. <ControlTemplate.Triggers>
  50. <Trigger Property="IsMouseOver" Value="true">
  51. <Setter TargetName="border" Property="Background" Value="#AA738199" />
  52. </Trigger>
  53. </ControlTemplate.Triggers>
  54. </ControlTemplate>
  55. </Setter.Value>
  56. </Setter>
  57. </Style>
  58. <common:HomePageFileListHeightConverter x:Key="HomePageFileListHeightConverter"></common:HomePageFileListHeightConverter>
  59. <common:CommonResourceConverter x:Key="CommonResourceConverter"></common:CommonResourceConverter>
  60. </UserControl.Resources>
  61. <Grid>
  62. <Grid.ColumnDefinitions>
  63. <ColumnDefinition Width="260"></ColumnDefinition>
  64. <ColumnDefinition></ColumnDefinition>
  65. </Grid.ColumnDefinitions>
  66. <Grid Margin="30,40" Height="auto" VerticalAlignment="Top"></Grid>
  67. <StackPanel Grid.Column="0" Margin="0,40,0,0">
  68. <Button Width="200" Height="64" Background="#001A4E" Click="OpenDocument_Click" Style="{StaticResource ButtonHoverStyle}">
  69. <StackPanel Orientation="Horizontal">
  70. <Image Source="{StaticResource OpenDocumentIcon}" Height="30" Width="30"></Image>
  71. <TextBlock Margin="12,0,0,0" VerticalAlignment="Center" Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Button_Open}" Foreground="White" FontFamily="Microsoft YaHei" FontSize="16" LineHeight="24"></TextBlock>
  72. </StackPanel>
  73. </Button>
  74. <Button Width="200" Height="64" Background="White" Margin="0,28,0,0" Click="CreateDocument_Click" Style="{StaticResource ButtonHoverStyle}">
  75. <StackPanel Orientation="Horizontal" Margin="5,0,0,0">
  76. <Image Source="{StaticResource CreateDocumentIcon}" Height="30" Width="30"></Image>
  77. <TextBlock Margin="12,0,0,0" VerticalAlignment="Center" Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Button_Create}" Foreground="#001A4E" FontFamily="Microsoft YaHei" FontSize="16" LineHeight="24"></TextBlock>
  78. </StackPanel>
  79. </Button>
  80. </StackPanel>
  81. <ScrollViewer Grid.Column="1" VerticalScrollBarVisibility="Auto" IsTabStop="True">
  82. <Grid x:Name="HomeGrid" Background="#F2F2F2">
  83. <Grid.RowDefinitions>
  84. <RowDefinition Height="580" ></RowDefinition>
  85. <RowDefinition> </RowDefinition>
  86. </Grid.RowDefinitions>
  87. <local:FeaturesListControl x:Name="FeaturesListControl" Margin=" 60,30,0,0"></local:FeaturesListControl>
  88. <local:RecentFilesControl Grid.Row="1" x:Name="RecentFilesControl" Margin="60,0,0,0" >
  89. <local:RecentFilesControl.Height>
  90. <MultiBinding Converter="{StaticResource HomePageFileListHeightConverter}">
  91. <Binding ElementName="HomePage" Path="ActualHeight"></Binding>
  92. <Binding ElementName="FeaturesListControl" Path="ActualHeight"></Binding>
  93. </MultiBinding>
  94. </local:RecentFilesControl.Height>
  95. </local:RecentFilesControl>
  96. </Grid>
  97. </ScrollViewer>
  98. </Grid>
  99. </UserControl>