<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
		 xmlns:res="clr-namespace:PDFTron.SilverDox.Samples.Resources"
    xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
	xmlns:util="clr-namespace:PDFTron.SilverDox.Samples.Utility">

	<!-- Localization string resource-->
	<res:StringResource x:Key="StringResource" />

	<!-- Converters -->
	<util:ZoomLevelConverter x:Key="ZoomLevelConverter" />
	<util:ModeConverter x:Key="ModeConverter" />
	<util:VisibilityConverter x:Key="VisibilityConverter" />
    <util:HideIfNullConverter x:Key="HideIfNullConverter"/>
    <!--<util:AnnotationCommentConverter x:Key="AnnotationCommentConverter" />-->

	<!-- Control Templates for DocumentViewer-->
	<ControlTemplate x:Key="RadialLayoutTemplate">
		<ScrollViewer x:Name="ScrollingView" CacheMode="BitmapCache"  Projection="{TemplateBinding Projection}"
                      VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <!-- Note: Background must be set in ScrollingViewContent, use #00FFFFFF for a transparent background  -->
            <Grid x:Name="ScrollingViewContent" Background="#00FFFFFF">
				<ItemsControl x:Name="PageContents" Background="#00FFFFFF">
					<ItemsControl.ItemsPanel>
						<ItemsPanelTemplate >
							<util:RadialPanel Radius="600" ItemAlignment="Center" ItemOrientation="Rotated" />
						</ItemsPanelTemplate>
					</ItemsControl.ItemsPanel>
				</ItemsControl>
			</Grid>
		</ScrollViewer>
	</ControlTemplate>

    <ControlTemplate x:Key="FacingLayoutTemplate">
        <ScrollViewer x:Name="ScrollingView" CacheMode="BitmapCache"  Projection="{TemplateBinding Projection}"
                      VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <!-- Note: Background must be set in ScrollingViewContent, use #00FFFFFF for a transparent background  -->
            <Grid x:Name="ScrollingViewContent" Background="#00FFFFFF">
                <ItemsControl x:Name="PageContents" >
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate >
                            <util:FacingPanel CoverFacing="False" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </Grid>
        </ScrollViewer>
    </ControlTemplate>

    <ControlTemplate x:Key="FacingCoverContinousLayoutTemplate">
        <ScrollViewer x:Name="ScrollingView" CacheMode="BitmapCache"  Projection="{TemplateBinding Projection}"
                      VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <!--  Note: Background must be set in ScrollingViewContent, use #00FFFFFF for a transparent background   -->
            <Grid x:Name="ScrollingViewContent" Background="#00FFFFFF">
                <ItemsControl x:Name="PageContents" >
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <util:FacingPanel CoverFacing="True" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </Grid>
        </ScrollViewer>
    </ControlTemplate>

    <ControlTemplate x:Key="VerticalLayoutTemplate">
		<ScrollViewer x:Name="ScrollingView" CacheMode="BitmapCache"  Projection="{TemplateBinding Projection}"
                      VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <!-- Note: Background must be set in ScrollingViewContent, use #00FFFFFF for a transparent background  -->
            <Grid x:Name="ScrollingViewContent" Background="#00000000">
                <ItemsControl x:Name="PageContents" >
					<ItemsControl.ItemsPanel>
						<ItemsPanelTemplate >
                            <VirtualizingStackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"/>
						</ItemsPanelTemplate>
					</ItemsControl.ItemsPanel>
				</ItemsControl>
			</Grid>
		</ScrollViewer>
	</ControlTemplate>

    <ControlTemplate x:Key="HorizontalLayoutTemplate">
        <ScrollViewer x:Name="ScrollingView" CacheMode="BitmapCache"  Projection="{TemplateBinding Projection}"
                      VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <Grid x:Name="ScrollingViewContent" Background="#00000000">
                <ItemsControl x:Name="PageContents" >
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate >
                            <VirtualizingStackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </Grid>
        </ScrollViewer>
    </ControlTemplate>

    <ControlTemplate x:Name="HiddenScrollBars" >
            <ScrollViewer  CacheMode="BitmapCache" x:Name="ScrollingView"   VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden">
            <Grid x:Name="ScrollingViewContent" Background="#00FFFFFF">
                    <ItemsControl x:Name="PageContents" >
                        <ItemsControl.Template>
                            <ControlTemplate TargetType="ItemsControl">
                                <ItemsPresenter/>
                            </ControlTemplate>
                        </ItemsControl.Template>
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate >
                                <VirtualizingStackPanel Orientation="Vertical" HorizontalAlignment="Center" />
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                    </ItemsControl>
                </Grid>
            </ScrollViewer>
    </ControlTemplate>


    <!-- Color brushes -->
    <LinearGradientBrush x:Key="OpalGradientBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="White" Offset="0.004" />
        <GradientStop Color="Gainsboro" Offset="1" />        
    </LinearGradientBrush>
    
	<LinearGradientBrush x:Key="OnyxGradientBrush" EndPoint="0.5,1" StartPoint="0.5,0">
		<GradientStop Color="#FFA8A7AF" Offset="0.004"/>
		<GradientStop Color="#FF18162B" Offset="1"/>
	</LinearGradientBrush>

    
    <!-- Styles -->
	<Style x:Key="OpalBorderStyle" TargetType="Border">
		<Setter Property="BorderBrush"	Value="#FF6C7474" />
		<Setter Property="BorderThickness"	Value="1" />
        <Setter Property="Background" Value="{StaticResource OpalGradientBrush}" />		
		<Setter Property="HorizontalAlignment"	Value="Stretch" />
	</Style>

    <Style x:Key="DividerStyle" TargetType="TextBlock">
		<Setter Property="Text" Value="|" />
		<Setter Property="Foreground" Value="Silver" />
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="Opacity" Value="0.3" />
		<Setter Property="Margin" Value="10,0,10,0" />
	</Style>

    <Style x:Key="ToolbarTextBlock" TargetType="TextBlock">
		<Setter Property="VerticalAlignment" Value="Center" />
		<Setter Property="HorizontalAlignment" Value="Right" />
		<Setter Property="Foreground" Value="Black" />
	</Style>
	
    <Style x:Key="HorizontalWrapListBox" TargetType="ListBox">
        <Style.Setters>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <controlsToolkit:WrapPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBox">
                        <!--<ScrollViewer>-->
                            <ItemsPresenter />
                        <!--</ScrollViewer>-->
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style.Setters>
    </Style>

    <!-- Annotation Tab Styles -->
    <Style TargetType="Border" x:Key="AnnotationTitleBorderStyle">
        <Setter Property="BorderBrush" Value="Gray"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="Background" Value="Beige"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
    </Style>
    <Style TargetType="TextBlock" x:Key="AnnotationWindowTitleTextBlockStyle">
        <Setter Property="HorizontalAlignment" Value="Center"/>
    </Style>
</ResourceDictionary>