1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <UserControl x:Class="ComPDFKitDemo.BOTA.ThumbnailsControl"
- 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="using:PDFViewWPFTestCS"
- xmlns:wpftk="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"
- mc:Ignorable="d"
- d:DesignHeight="138" d:DesignWidth="223"
- Loaded="UserControl_Loaded"
- Unloaded="UserControl_Unloaded"
- PreviewMouseWheel ="UserControl_PreviewMouseWheel">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="../Resources/StyleResource.xaml"/>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid>
- <ListBox Name="ThumbnailListBox" SelectionChanged="ThumbnailListBox_SelectionChanged"
- SelectionMode="Extended" ScrollViewer.CanContentScroll="True"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ScrollViewer.ScrollChanged="thumbnailScrollViewer_ScrollChanged"
- ScrollBar.Scroll="ThumbnailListBox_Scroll"
- Background="White" VirtualizingPanel.IsVirtualizing="True"
- VirtualizingPanel.VirtualizationMode="Recycling">
- <ListBox.Resources>
- <Style TargetType="ListBoxItem">
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- </Style>
- </ListBox.Resources>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <wpftk:VirtualizingWrapPanel></wpftk:VirtualizingWrapPanel>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel>
- <Viewbox Margin="0,5,0,0" Stretch="Uniform" Width="{Binding ThumbnailWidth}" Height="{Binding ThumbnailHeight}">
- <Border BorderThickness="2" BorderBrush="Black">
- <Image Source="{Binding Path=ImageData.Source}" Margin="0,0,5,0" Width="{Binding ImageWidth}" Height="{Binding ImageHeight}"></Image>
- </Border>
- </Viewbox>
- <TextBlock Text="{Binding ShowPageText}" HorizontalAlignment="Center"></TextBlock>
- </StackPanel>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </UserControl>
|