mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-14 20:29:07 +00:00
.
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
<UserControl x:Class="QuickLook.Plugin.PDFViewer.PdfViewerControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:QuickLook.Plugin.PDFViewer"
|
||||
mc:Ignorable="d"
|
||||
x:Name="thisPdfViewer"
|
||||
UseLayoutRounding="True"
|
||||
d:DesignHeight="476.974"
|
||||
d:DesignWidth="720.29">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<local:PageIdToImageConverter x:Key="PageIdToImageConverter" />
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ListBoxItemStyleNoFocusedBorder.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox x:Name="listThumbnails" Grid.Column="0" VirtualizingPanel.ScrollUnit="Item"
|
||||
ScrollViewer.IsDeferredScrollingEnabled="False"
|
||||
SelectedIndex="0"
|
||||
Focusable="False"
|
||||
Background="#00FFFFFF"
|
||||
ItemsSource="{Binding PageIds, ElementName=thisPdfViewer}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled" BorderThickness="0,0,1,0"
|
||||
ItemContainerStyle="{Binding Mode=OneWay, Source={StaticResource ListBoxItemStyleNoFocusedBorder}}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid MaxHeight="150"
|
||||
MaxWidth="{Binding ViewportWidth, Mode=Default, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ScrollViewer}}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="10" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border x:Name="bbd" Grid.Row="1" Grid.Column="1" BorderThickness="1" BorderBrush="#FFE1E1E1">
|
||||
<Image>
|
||||
<Image.Source>
|
||||
<MultiBinding Converter="{StaticResource PageIdToImageConverter}">
|
||||
<Binding Path="PdfHandleForThumbnails" ElementName="thisPdfViewer" />
|
||||
<Binding />
|
||||
</MultiBinding>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
</Border>
|
||||
<!--
|
||||
<Label Grid.Row="1" Grid.Column="1" Content="{Binding Mode=OneWay, Converter={StaticResource MathConverter}, ConverterParameter=@VALUE+1}" FontSize="14" />
|
||||
-->
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger
|
||||
Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
|
||||
Value="True">
|
||||
<Setter TargetName="bbd" Property="BorderBrush" Value="#FF0040FF" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<Grid Grid.Column="1" Background="#00EFEFEF">
|
||||
<ScrollViewer x:Name="pageViewPanel" HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto" Focusable="False">
|
||||
<Image x:Name="pageViewPanelImage" Stretch="None" RenderOptions.BitmapScalingMode="NearestNeighbor" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
Reference in New Issue
Block a user