<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:PdfViewerSamples" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml">


    <Style TargetType="local:Thumbnails">
        <Setter Property="SelectedBrush" Value="#FFC0DEEA" />
        <Setter Property="Background" Value="White" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Thumbnails">
                    <ScrollViewer x:Name="ScrollViewer" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <ItemsPresenter />
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ThumbnailItem">
        <Setter Property="Margin" Value="10" />
        <Setter Property="BorderBrush" Value="DarkGray" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Scale" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ThumbnailItem">
                    <Grid>
                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <Border.Resources>
                                <c1:ZoomToScaleTransformConverter x:Name="scaleConverter" />
                            </Border.Resources>
                            <c1:C1LayoutTransformer LayoutTransform="{Binding Scale, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource scaleConverter}}">
                                <c1:C1LayoutTransformer.CacheMode>
                                    <BitmapCache RenderAtScale="1" />
                                </c1:C1LayoutTransformer.CacheMode>
                                <ContentPresenter x:Name="ContentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" />
                            </c1:C1LayoutTransformer>
                        </Border>
                        <Grid Background="Transparent" IsHitTestVisible="True" Cursor="Hand" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>