PreviewControl.xaml 6.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <UserControl x:Class="Compdfkit_Tools.PDFControl.PreviewControl"
  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_Tools.PDFControl"
  7. mc:Ignorable="d"
  8. d:DesignHeight="449" d:DesignWidth="248">
  9. <UserControl.Resources>
  10. <ResourceDictionary>
  11. <ResourceDictionary.MergedDictionaries>
  12. </ResourceDictionary.MergedDictionaries>
  13. <Style x:Key="TransparentButtonStyle" TargetType="{x:Type Button}">
  14. <Setter Property="Background" Value="Transparent" />
  15. <Setter Property="BorderThickness" Value="0" />
  16. <Setter Property="Template">
  17. <Setter.Value>
  18. <ControlTemplate TargetType="Button">
  19. <ContentPresenter />
  20. <ControlTemplate.Triggers>
  21. <Trigger Property="IsMouseOver" Value="True">
  22. <Setter Property="Background" Value="#1a000000" />
  23. </Trigger>
  24. <Trigger Property="IsPressed" Value="True">
  25. <Setter Property="Background" Value="#5a000000" />
  26. </Trigger>
  27. </ControlTemplate.Triggers>
  28. </ControlTemplate>
  29. </Setter.Value>
  30. </Setter>
  31. </Style>
  32. <Style x:Key="PageButtonStyle" TargetType="{x:Type Button}">
  33. <Setter Property="Background" Value="#E1E1E1"></Setter>
  34. <Setter Property="BorderThickness" Value="0"></Setter>
  35. <Setter Property="Template">
  36. <Setter.Value>
  37. <ControlTemplate TargetType="Button">
  38. <ContentPresenter />
  39. <ControlTemplate.Triggers>
  40. <Trigger Property="IsMouseOver" Value="True">
  41. <Setter Property="Background" Value="#C1C1C1" />
  42. </Trigger>
  43. <Trigger Property="IsMouseOver" Value="False">
  44. <Setter Property="Background" Value="#E1E1E1" />
  45. </Trigger>
  46. <Trigger Property="IsPressed" Value="True">
  47. <Setter Property="Background" Value="#A1A1A1" />
  48. </Trigger>
  49. </ControlTemplate.Triggers>
  50. </ControlTemplate>
  51. </Setter.Value>
  52. </Setter>
  53. </Style>
  54. </ResourceDictionary>
  55. </UserControl.Resources>
  56. <Grid>
  57. <Grid.RowDefinitions>
  58. <RowDefinition Height="auto"></RowDefinition>
  59. <RowDefinition></RowDefinition>
  60. <RowDefinition Height="auto"></RowDefinition>
  61. </Grid.RowDefinitions>
  62. <Grid Margin="0,0,0,10">
  63. <TextBlock Text="Preview" FontWeight="DemiBold" FontFamily="Segoe UI" FontSize="14"></TextBlock>
  64. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
  65. <Button Style="{StaticResource TransparentButtonStyle}" Margin="0,0,10,0">
  66. <Path Data="M0,6.5 C0,2.91015 2.91015,0 6.5,0 C10.0899,0 13,2.91015 13,6.5 C13,8.12212 12.4058,9.60545 11.4232,10.7442 L15.5,14.821 L14.821,15.5 L10.7442,11.4232 C9.60545,12.4058 8.12212,13 6.5,13 C2.91015,13 0,10.0899 0,6.5 Z M12,6.5 C12,3.46243 9.53757,1 6.5,1 C3.46243,1 1,3.46243 1,6.5 C1,9.53757 3.46243,12 6.5,12 C9.53757,12 12,9.53757 12,6.5 Z M10,6 V7 H3 V6 H10 Z"
  67. Fill="Black" />
  68. </Button>
  69. <Button Style="{StaticResource TransparentButtonStyle}">
  70. <Path Data="M6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.12212 13 9.60545 12.4058 10.7442 11.4232L14.821 15.5L15.5 14.821L11.4232 10.7442C12.4058 9.60545 13 8.12212 13 6.5C13 2.91015 10.0899 0 6.5 0ZM6.5 1C9.53757 1 12 3.46243 12 6.5C12 9.53757 9.53757 12 6.5 12C3.46243 12 1 9.53757 1 6.5C1 3.46243 3.46243 1 6.5 1ZM10 6H7V3H6V6H3V7H6V10H7V7H10V6Z"
  71. Fill="Black" />
  72. </Button>
  73. </StackPanel>
  74. </Grid>
  75. <Border Grid.Row="1" x:Name="ImageGd" Background="#1A000000" ClipToBounds="True" BorderThickness="1" BorderBrush="#000000">
  76. <ScrollViewer x:Name="ImageSv" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  77. <Image x:Name="Image" Source="{Binding ImageSource}" Stretch="None" MouseLeftButtonDown="Image_MouseLeftButtonDown" MouseLeftButtonUp="Image_MouseLeftButtonUp" MouseMove="Image_MouseMove">
  78. <Image.LayoutTransform>
  79. <ScaleTransform ScaleX="{Binding Scale}" ScaleY="{Binding Scale}"></ScaleTransform>
  80. </Image.LayoutTransform>
  81. </Image>
  82. </ScrollViewer>
  83. </Border>
  84. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="2" Margin="0,8,0,0">
  85. <Button x:Name="PrePageBtn" Height="28" Width="28" Margin="0,0,16,0" Style="{StaticResource PageButtonStyle}">
  86. <Path Height="16" Width="16" Data="M11.2978 14L12 13.2733L6.90446 8L12 2.72673L11.2978 2L5.5 8L11.2978 14Z"
  87. Fill="Black" />
  88. </Button>
  89. <TextBox Height="32" Width="48" Margin="0,0,8,0"></TextBox>
  90. <TextBlock Text="/" FontSize="14" VerticalAlignment="Center" FontFamily="Segoe UI"></TextBlock>
  91. <TextBlock Text="{Binding SumPage}" Margin="5,0,0,0" FontSize="14" VerticalAlignment="Center" FontFamily="Segoe UI"></TextBlock>
  92. <Button x:Name="NextPageBtn" Height="28" Width="28" Margin="16,0,0,0" Style="{StaticResource PageButtonStyle}">
  93. <Path Height="16" Width="16" Data="M6.20223 14L5.5 13.2733L10.5955 8L5.5 2.72673L6.20223 2L12 8L6.20223 14Z"
  94. Fill="Black" />
  95. </Button>
  96. </StackPanel>
  97. </Grid>
  98. </UserControl>