<UserControl x:Class="SilverlightDemo_SL4.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:PerpetuumSoft.Reporting.Silverlight.Client;assembly=PerpetuumSoft.Reporting.Silverlight.Client" 
    xmlns:printing="clr-namespace:PerpetuumSoft.Reporting.Silverlight.Client.Printing;assembly=PerpetuumSoft.Reporting.Silverlight.Client" 
    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <UserControl.Resources>
        
    <LinearGradientBrush x:Key="PrintingBorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF474342" Offset="0"/>
        <GradientStop Color="#FF6C6C6C" Offset="0.4"/>
        <GradientStop Color="#FF7C7C7C" Offset="1"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PrintingChromeBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="WhiteSmoke" Offset="0"/>
        <GradientStop Color="#FF323232" Offset="0.6"/>
        <GradientStop Color="#FF474342" Offset="1"/>
    </LinearGradientBrush>

    <Style x:Key="DefaultPrintingDialogStyle" TargetType="printing:PrintingDialog">
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="TabNavigation" Value="Cycle"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="Black" />
        <Setter Property="OverlayBrush" Value="#3F000000"/>
        <Setter Property="OverlayOpacity" Value="1"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="printing:PrintingDialog">
                    <Grid x:Name="Root">
                        <Grid.Resources>
                            <Style x:Key="ButtonStyle" TargetType="Button">
                                <Setter Property="Background" Value="#FF1F3B53"/>
                                <Setter Property="Foreground" Value="#FF000000"/>
                                <Setter Property="Padding" Value="3"/>
                                <Setter Property="BorderThickness" Value="1"/>
                                <Setter Property="BorderBrush">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFA3AEB9" Offset="0"/>
                                            <GradientStop Color="#FF8399A9" Offset="0.375"/>
                                            <GradientStop Color="#FF718597" Offset="0.375"/>
                                            <GradientStop Color="#FF617584" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid x:Name="grid" Height="14" HorizontalAlignment="Center" VerticalAlignment="Center" Width="15" Background="#02FFFFFF">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal"/>
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To="0.95"/>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To="0.85"/>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz2" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz1" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="X_Fuzz0" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                                                </ObjectAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <DoubleAnimation Duration="0" Storyboard.TargetName="X" Storyboard.TargetProperty="Opacity" To="0.5"/>
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Path x:Name="X_Fuzz2" Fill="#14C51900" Stretch="Fill" Stroke="#14C51900" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="1" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z">
                                                    <Path.RenderTransform>
                                                        <TransformGroup>
                                                            <ScaleTransform ScaleX="1.3" ScaleY="1.3"/>
                                                        </TransformGroup>
                                                    </Path.RenderTransform>
                                                </Path>
                                                <Path x:Name="X_Fuzz1" Fill="#1EC51900" Stretch="Fill" Stroke="#1EC51900" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="1" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z">
                                                    <Path.RenderTransform>
                                                        <TransformGroup>
                                                            <ScaleTransform ScaleX="1.1" ScaleY="1.1"/>
                                                        </TransformGroup>
                                                    </Path.RenderTransform>
                                                </Path>
                                                <Path x:Name="X_Fuzz0" Fill="#FFC51900" Stretch="Fill" Stroke="#FFC51900" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="1" Visibility="Collapsed" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z"/>
                                                <Path x:Name="X" Fill="#FFFFFFFF" Stretch="Fill" Height="8" HorizontalAlignment="Center" Margin="0,-1,0,0" VerticalAlignment="Center" Width="9" Opacity="0.7" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z">
                                                    <Path.Stroke>
                                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                            <GradientStop Color="#FF313131" Offset="1"/>
                                                            <GradientStop Color="#FF8E9092" Offset="0"/>
                                                        </LinearGradientBrush>
                                                    </Path.Stroke>
                                                </Path>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="WindowStates">
                                <VisualState x:Name="Open">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="Overlay" Storyboard.TargetProperty="Opacity">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="1.05" KeySpline="0,0,0.5,1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="1.05" KeySpline="0,0,0.5,1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Closed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="Overlay" Storyboard.TargetProperty="Opacity">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                            <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetName="ContentRoot" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="Overlay" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top" Opacity="{TemplateBinding OverlayOpacity}" Background="{TemplateBinding OverlayBrush}"/>
                        <Grid x:Name="ContentRoot" Height="{TemplateBinding Height}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}" RenderTransformOrigin="0.5,0.5">
                            <Grid.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform/>
                                    <SkewTransform/>
                                    <RotateTransform/>
                                    <TranslateTransform/>
                                </TransformGroup>
                            </Grid.RenderTransform>
                            <Border HorizontalAlignment="Stretch" Margin="-1" VerticalAlignment="Stretch" Background="#14000000" BorderBrush="#14000000" BorderThickness="0" CornerRadius="2"/>
                            <Border HorizontalAlignment="Stretch" Margin="-2" VerticalAlignment="Stretch" Background="#0F000000" BorderBrush="#0F000000" BorderThickness="0" CornerRadius="2"/>
                            <Border HorizontalAlignment="Stretch" Margin="-3" VerticalAlignment="Stretch" Background="#0C000000" BorderBrush="#0C000000" BorderThickness="0" CornerRadius="2"/>
                            <Border HorizontalAlignment="Stretch" Margin="-4" VerticalAlignment="Stretch" Background="#0A000000" BorderBrush="#0A000000" BorderThickness="0" CornerRadius="2"/>
                            <Border Background="#FFF6F8F9" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0">
                                <Border Margin="0" CornerRadius="5">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFE5E8EB" Offset="1"/>
                                            <GradientStop Color="#FFF6F8F9" Offset="0"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" MinHeight="24.667"/>
                                            <RowDefinition/>
                                        </Grid.RowDefinitions>

                                        <Border x:Name="Chrome" Width="Auto" BorderBrush="#FF000000" BorderThickness="0,0,0,0" CornerRadius="0" Background="{TemplateBinding Chrome}">

                                            <Grid Height="Auto" Width="Auto">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition/>
                                                    <ColumnDefinition Width="30"/>
                                                </Grid.ColumnDefinitions>
                                                <ContentControl FontWeight="Bold" IsTabStop="False" HorizontalAlignment="Stretch" Margin="6,0,6,0" VerticalAlignment="Center" Content="{TemplateBinding Title}" Foreground="WhiteSmoke"/>
                                                <Button x:Name="CloseButton" IsTabStop="False" Height="14" HorizontalAlignment="Center" Style="{StaticResource ButtonStyle}" VerticalAlignment="Center" Width="15" Grid.Column="1"/>
                                            </Grid>
                                        </Border>

                                        <Border Grid.Row="1" CornerRadius="0" Background="{TemplateBinding ContentRoot}">
                                        </Border>

                                        <Border Margin="5 0 5 5" Grid.Row="1" Background="{TemplateBinding Background}" >
                                            <ContentPresenter x:Name="ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                        </Border>
                                    </Grid>
                                </Border>
                            </Border>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ProgressStyle" TargetType="local:Progress" >
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="Width" Value="220"/>
        <Setter Property="Height" Value="80"/>
    </Style>

    <LinearGradientBrush x:Key="NavigatePanelActive">
        <GradientStop Offset="0" Color="#FFC0C7CD"/>
        <GradientStop Offset="1" Color="#FFC0C7CD"/>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="BackgroundActiveNavigationElement">
        <GradientStop Offset="0" Color="#FFE9EAEE"/>
        <GradientStop Offset="1" Color="#FFE9EAEE"/>
    </LinearGradientBrush>

    <Style x:Key="CustomReportViewer" TargetType="local:ReportViewer">
        <Setter Property="LoadingStateStyle" Value="{StaticResource ProgressStyle}"/>
        <Setter Property="RenderingStateStyle" Value="{StaticResource ProgressStyle}"/>

        <Setter Property="PrintingDialogStyle" Value="{StaticResource DefaultPrintingDialogStyle}"/>
        <Setter Property="PrintingDialogBorderBrush" Value="{StaticResource PrintingBorderBrush}"/>
        <Setter Property="PrintingDialogChromeBrush" Value="{StaticResource PrintingChromeBrush}"/>

        <Setter Property="NavigationPanelBackground" Value="{StaticResource NavigatePanelActive}"/>
        <Setter Property="IsActiveNavigationPanel" Value="false"/>
        <Setter Property="DocumentElementBackground" Value="{StaticResource BackgroundActiveNavigationElement}"/>
        <Setter Property="DocumentColumnMinWidth" Value="100"/>
        <Setter Property="VisibilityNavigationPanel" Value="Visible"/>
        <Setter Property="NavigationPanelWidth" Value="36"/>

        <Setter Property="ToolBarBackground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FF3D3D3D" Offset="1"/>
                    <GradientStop Color="#FF333333" Offset="0.5"/>
                    <GradientStop Color="#FF5A5A5A" Offset="0.491"/>
                    <GradientStop Color="#FF9E9E9E" Offset="0"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>

        <Setter Property="ToolBarForeground" Value="White"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ReportViewer">
                    <Grid x:Name="LayoutRoot">
                        <Grid x:Name="ViewerRoot">
                            <Grid.Resources>

                                <ControlTemplate x:Key="ToolTipTemplate" TargetType="ToolTip">
                                    <Border CornerRadius="6" Background="Bisque" BorderBrush="Black" BorderThickness="1" Padding="2">
                                        <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}"/>
                                    </Border>
                                </ControlTemplate>

                                <ControlTemplate x:Key="BackBtn" TargetType="Button">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="FocusStates">
                                                <VisualState x:Name="Unfocused"/>
                                                <VisualState x:Name="Focused"/>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Normal" To="MouseOver"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="MouseOver" To="Normal"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="MouseOver" To="Pressed"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="Pressed" To="MouseOver"/>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image2" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Normal">
                                                    <Storyboard/>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/BackwardDisabled32.png" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/BackwardEnabled32.png" x:Name="image" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/BackwardPressed32.png" x:Name="image1" Opacity="0" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/BackwardHighlighted32.png" x:Name="image2" Opacity="0" Stretch="None"/>
                                    </Grid>
                                </ControlTemplate>

                                <ControlTemplate x:Key="FrwBtn" TargetType="Button">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="FocusStates">
                                                <VisualState x:Name="Unfocused"/>
                                                <VisualState x:Name="Focused"/>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Normal" To="MouseOver"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="MouseOver" To="Normal"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="MouseOver" To="Pressed"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="Pressed" To="MouseOver"/>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image2" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Normal">
                                                    <Storyboard/>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ForwardDisabled32.png"  Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ForwardEnabled32.png" x:Name="image" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ForwardPressed32.png" x:Name="image1" Opacity="0" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ForwardHighlighted32.png" x:Name="image2" Opacity="0" Stretch="None"/>
                                    </Grid>
                                </ControlTemplate>

                                <ControlTemplate x:Key="MinusBtn" TargetType="Button">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="FocusStates">
                                                <VisualState x:Name="Unfocused"/>
                                                <VisualState x:Name="Focused"/>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Normal" To="MouseOver"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="MouseOver" To="Normal"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="MouseOver" To="Pressed"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="Pressed" To="MouseOver"/>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image2" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Normal">
                                                    <Storyboard/>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonMinus.png" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonMinus.png" x:Name="image" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonMinusPressed.png" x:Name="image1" Opacity="0" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonMinusEnabled.png" x:Name="image2" Opacity="0" Stretch="None"/>
                                    </Grid>
                                </ControlTemplate>

                                <ControlTemplate x:Key="PlusBtn" TargetType="Button">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="FocusStates">
                                                <VisualState x:Name="Unfocused"/>
                                                <VisualState x:Name="Focused"/>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Normal" To="MouseOver"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="MouseOver" To="Normal"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="MouseOver" To="Pressed"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="Pressed" To="MouseOver"/>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image2" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Normal">
                                                    <Storyboard/>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonPlus.png" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonPlus.png" x:Name="image" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonPlusPressed.png" x:Name="image1" Opacity="0" Stretch="None"/>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonPlusEnabled.png" x:Name="image2" Opacity="0" Stretch="None"/>
                                    </Grid>
                                </ControlTemplate>

                                <ControlTemplate x:Key="ToolBtn" TargetType="local:ToolButton">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="FocusStates">
                                                <VisualState x:Name="Unfocused"/>
                                                <VisualState x:Name="Focused"/>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Normal" To="MouseOver"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="MouseOver" To="Normal"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="MouseOver" To="Pressed"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.1000000" From="Pressed" To="MouseOver"/>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle_Copy" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="contentPresenter1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Normal">
                                                    <Storyboard/>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Opacity="0" x:Name="rectangle" RadiusX="4" RadiusY="4">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFE2C507"/>
                                                    <GradientStop Color="#FFFDE539" Offset="0.996"/>
                                                    <GradientStop Color="#FFFFF193" Offset="0.461"/>
                                                    <GradientStop Color="#FFD2B812" Offset="0.49"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="rectangle_Copy" VerticalAlignment="Stretch" Opacity="0" RadiusX="4" RadiusY="4">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFF78C0B"/>
                                                    <GradientStop Color="#FF954B00" Offset="0.992"/>
                                                    <GradientStop Color="#FFF4881C" Offset="0.461"/>
                                                    <GradientStop Color="#FFFF6800" Offset="0.49"/>
                                                    <GradientStop Color="#FFCC9607" Offset="0.921"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding DisabledContent}" Opacity="0" x:Name="contentPresenter"/>
                                        <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" x:Name="contentPresenter1"/>
                                        <ToolTipService.ToolTip>
                                            <ToolTip Template="{StaticResource ToolTipTemplate}" Content="{TemplateBinding TooltipText}"></ToolTip>
                                        </ToolTipService.ToolTip>
                                    </Grid>
                                </ControlTemplate>

                                <ControlTemplate x:Key="Sep" TargetType="local:Separator">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>
                                        <Rectangle Fill="#FF646464" Grid.Column="0" Width="1"/>
                                        <Rectangle Fill="#FFA7A7A7" Grid.Column="1" Width="1"/>
                                    </Grid>
                                </ControlTemplate>

                                <Style x:Key="ZoomThumb" TargetType="Thumb">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Thumb">
                                                <Grid>
                                                    <VisualStateManager.VisualStateGroups>
                                                        <VisualStateGroup x:Name="CommonStates">
                                                            <VisualStateGroup.Transitions>
                                                                <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver"/>
                                                                <VisualTransition GeneratedDuration="0:0:0.1" To="Pressed"/>
                                                                <VisualTransition GeneratedDuration="0:0:0.1" To="Disabled"/>
                                                            </VisualStateGroup.Transitions>
                                                            <VisualState x:Name="Normal"/>
                                                            <VisualState x:Name="MouseOver">
                                                                <Storyboard>
                                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                                    </DoubleAnimationUsingKeyFrames>
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState x:Name="Pressed">
                                                                <Storyboard>
                                                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                                        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                                    </DoubleAnimationUsingKeyFrames>
                                                                </Storyboard>
                                                            </VisualState>
                                                            <VisualState x:Name="Disabled">
                                                                <Storyboard/>
                                                            </VisualState>
                                                        </VisualStateGroup>
                                                    </VisualStateManager.VisualStateGroups>
                                                    <Image Stretch="None" Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/SliderDisabled.png"/>
                                                    <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/SliderEnabled.png" Stretch="None" Opacity="0" x:Name="image"/>
                                                    <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/SliderPressed.png" Stretch="None" Opacity="0" x:Name="image1"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <Style x:Key="ZoomSlider" TargetType="Slider">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="Slider">
                                                <Grid x:Name="Root">
                                                    <Grid.Resources>
                                                        <ControlTemplate x:Key="RepeatButtonTemplate">
                                                            <Grid x:Name="Root" Opacity="0" Background="Transparent"/>
                                                        </ControlTemplate>
                                                    </Grid.Resources>
                                                    <Grid x:Name="HorizontalTemplate">
                                                        <Grid.ColumnDefinitions>
                                                            <ColumnDefinition Width="Auto"/>
                                                            <ColumnDefinition Width="Auto"/>
                                                            <ColumnDefinition Width="*"/>
                                                        </Grid.ColumnDefinitions>
                                                        <Rectangle Height="3" Margin="5,0,5,0" Grid.Column="0" Grid.ColumnSpan="3" StrokeThickness="0.5">
                                                            <Rectangle.Fill>
                                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                    <GradientStop Color="#FF000000"/>
                                                                    <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                                                </LinearGradientBrush>
                                                            </Rectangle.Fill>
                                                        </Rectangle>
                                                        <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0"/>
                                                        <Thumb  x:Name="HorizontalThumb" Grid.Column="1" Style="{StaticResource ZoomThumb}"/>
                                                        <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2"/>
                                                    </Grid>
                                                    <Grid x:Name="VerticalTemplate" Visibility="Collapsed">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition Height="*"/>
                                                            <RowDefinition Height="Auto"/>
                                                            <RowDefinition Height="Auto"/>
                                                        </Grid.RowDefinitions>
                                                        <Rectangle Margin="0,5,0,5" Width="3" Grid.Row="0" Grid.RowSpan="3" Fill="#FFE6EFF7" Stroke="Black" StrokeThickness="0.5"/>
                                                        <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" Grid.Row="2"/>
                                                        <Thumb Height="11" x:Name="VerticalThumb" Width="18" Grid.Row="1"/>
                                                        <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" Grid.Row="0"/>
                                                    </Grid>
                                                    <Rectangle x:Name="FocusVisual" IsHitTestVisible="false" Opacity="0" Stroke="#666666" StrokeDashArray=".2 5" StrokeDashCap="Round"/>
                                                </Grid>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>

                                <ControlTemplate x:Key="TglBtn" TargetType="local:ToggleToolButton">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="FocusStates">
                                                <VisualState x:Name="Focused"/>
                                                <VisualState x:Name="Unfocused"/>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Normal" To="MouseOver"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="MouseOver" To="Normal"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="MouseOver" To="Pressed"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Pressed" To="MouseOver"/>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="contentPresenter1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Normal">
                                                    <Storyboard/>
                                                </VisualState>
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle_Copy" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CheckStates">
                                                <VisualState x:Name="Checked">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="rectangle_Copy1" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Unchecked"/>
                                                <VisualState x:Name="Indeterminate"/>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="rectangle_Copy1" VerticalAlignment="Stretch" Opacity="0" RadiusX="4" RadiusY="4">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFFFBA67"/>
                                                    <GradientStop Color="#FF6A3500" Offset="0.992"/>
                                                    <GradientStop Color="#FFF4881C" Offset="0.461"/>
                                                    <GradientStop Color="#FFFF6800" Offset="0.49"/>
                                                    <GradientStop Color="#FF846001" Offset="0.921"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Opacity="0" x:Name="rectangle" RadiusX="4" RadiusY="4">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFE2C507"/>
                                                    <GradientStop Color="#FFFDE539" Offset="0.996"/>
                                                    <GradientStop Color="#FFFFF193" Offset="0.461"/>
                                                    <GradientStop Color="#FFD2B812" Offset="0.49"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <Rectangle HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="rectangle_Copy" VerticalAlignment="Stretch" Opacity="0" RadiusX="4" RadiusY="4">
                                            <Rectangle.Fill>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFF78C0B"/>
                                                    <GradientStop Color="#FF954B00" Offset="0.992"/>
                                                    <GradientStop Color="#FFF4881C" Offset="0.461"/>
                                                    <GradientStop Color="#FFFF6800" Offset="0.49"/>
                                                    <GradientStop Color="#FFCC9607" Offset="0.921"/>
                                                </LinearGradientBrush>
                                            </Rectangle.Fill>
                                        </Rectangle>
                                        <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding DisabledContent}" Opacity="0" x:Name="contentPresenter"/>
                                        <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" x:Name="contentPresenter1"/>
                                        <ToolTipService.ToolTip>
                                            <ToolTip Template="{StaticResource ToolTipTemplate}" Content="{TemplateBinding TooltipText}"></ToolTip>
                                        </ToolTipService.ToolTip>
                                    </Grid>
                                </ControlTemplate>

                                <ControlTemplate x:Name="NavigationPanelButton" TargetType="local:ToggleImageButton">
                                    <Grid>
                                        <VisualStateManager.VisualStateGroups >
                                            <VisualStateGroup x:Name="OverrideCommonStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Normal1" To="MouseOver1"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="MouseOver1" To="Normal1"/>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="OverrideMouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Active" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="nonActive" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="OverrideNormal">
                                                </VisualState>
                                            </VisualStateGroup>

                                            <VisualStateGroup x:Name="CheckStates">
                                                <VisualStateGroup.Transitions>
                                                    <VisualTransition GeneratedDuration="00:00:00.2000000" From="Unchecked" To="Checked"/>
                                                    <VisualTransition GeneratedDuration="00:00:00.0500000" From="Checked" To="Unchecked"/>
                                                </VisualStateGroup.Transitions>
                                                <VisualState x:Name="Checked">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="00:00:00.0010000" To="1" Storyboard.TargetName="Active" Storyboard.TargetProperty="Opacity"/>
                                                        <DoubleAnimation Duration="00:00:00.0010000" From="1" Storyboard.TargetName="nonActive" Storyboard.TargetProperty="Opacity"/>
                                                        <DoubleAnimation Duration="00:00:00.0010000" To="1" Storyboard.TargetName="ElementBackground" Storyboard.TargetProperty="Opacity"/>
                                                        <DoubleAnimation Duration="00:00:00.0010000" To="1" Storyboard.TargetName="ElementBorder" Storyboard.TargetProperty="Opacity"/>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Unchecked">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" From="1" Storyboard.TargetName="Active" Storyboard.TargetProperty="Opacity"/>
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="nonActive" Storyboard.TargetProperty="Opacity"/>
                                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetName="ElementBackground" Storyboard.TargetProperty="Opacity"/>
                                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetName="ElementBorder" Storyboard.TargetProperty="Opacity"/>
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Rectangle Margin="2 2 -2 2" x:Name="ElementBackground" Fill="{TemplateBinding Background}" 
                                                   Opacity="0" StrokeThickness="0" Stroke="Transparent">
                                        </Rectangle>
                                        <Image Margin="5" x:Name="nonActive" Stretch="None" Source="{TemplateBinding NotActiveImage}" Opacity="1"/>
                                        <Image Margin="5" x:Name="Active" Stretch="None" Source="{TemplateBinding ActiveImage}" Opacity="0"/>
                                        <Border x:Name="ElementBorder" BorderBrush="#FF8A8F93" BorderThickness="1,1,0,1" Margin="1,1,-1,1" Opacity="0"/>
                                        <ContentPresenter
                                                      x:Name="contentPresenter"
                                                      Content="{TemplateBinding Content}"
                                                      ContentTemplate="{TemplateBinding ContentTemplate}"
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                      Margin="{TemplateBinding Padding}"/>

                                    </Grid>
                                </ControlTemplate>

                                <ControlTemplate x:Name="GridSplitter" TargetType="Controls:GridSplitter">
                                    <Grid>
                                        <Rectangle Fill="{TemplateBinding Background}"/>
                                        <Image VerticalAlignment="Center" Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/GridSplitter102x4.png"/>
                                    </Grid>
                                </ControlTemplate>

                            </Grid.Resources>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <!-- Top tool bar-->
                            <Grid Grid.Row="0" Visibility="{TemplateBinding ToolBarVisible}" Background="{TemplateBinding ToolBarBackground}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*" MinWidth="100"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <StackPanel Orientation="Horizontal" Grid.Column="0" HorizontalAlignment="Stretch">

                                        <!--<Button x:Name="RefreshButton" Margin="0,2,0,2" IsTabStop="False" Content="Refresh" Click="RefreshButton_OnClick">
                                    </Button> -->

                                    <Button x:Name="BackwardButton" Template="{StaticResource BackBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <ToolTipService.ToolTip>
                                            <ToolTip Template="{StaticResource ToolTipTemplate}"/>
                                        </ToolTipService.ToolTip>
                                    </Button>
                                    <Button x:Name="ForwardButton" Template="{StaticResource FrwBtn}" Margin="0,2,0,2"  IsTabStop="False">
                                        <ToolTipService.ToolTip>
                                            <ToolTip Template="{StaticResource ToolTipTemplate}"/>
                                        </ToolTipService.ToolTip>
                                    </Button>

                                    <local:Separator Template="{StaticResource Sep}" Margin="2,4,2,4"/>

                                    <local:ToolButton x:Name="PrintButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/PrintDisabled32.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/PrintEnabled32.png" Stretch="None" Height="32" Width="32"/>
                                    </local:ToolButton>

                                    <local:Separator Template="{StaticResource Sep}" Margin="2,4,2,4"/>

                                  <!--  <local:ToolButton x:Name="RtfExportButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/RTFDisabled32.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/RTF32.png" Stretch="None" Height="32" Width="32"/>
                                    </local:ToolButton> -->
                                    
                                   <!--  <local:ToolButton x:Name="XpsExportButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/XPSDisabled32.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/XPS32.png" Stretch="None" Height="32" Width="32"/>
                                    </local:ToolButton> -->
                                    
                                    <local:ToolButton x:Name="PdfExportButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/PDFDisabled32.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/PDFEnabled32.png" Stretch="None" Height="32" Width="32"/>
                                    </local:ToolButton>
                                    <local:ToolButton x:Name="ExcelExportButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ExcelDisabled32.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ExcelEnabled32.png" Stretch="None" Height="32" Width="32"/>
                                    </local:ToolButton>
                                    
                                <!--    <local:ToolButton x:Name="HtmlExportButton" Margin="0,2,0,2" Template="{StaticResource ToolBtn}" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/HTMLDisabled32.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/HTMLEnabled32.png" Stretch="None" Height="32" Width="32"/>
                                    </local:ToolButton>  -->

                                    <local:Separator Template="{StaticResource Sep}" Margin="2,4,2,4"/>

                                    <local:ToggleToolButton x:Name="Zoom100Button" Margin="0,2,0,2" Template="{StaticResource TglBtn}" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ActualSizeDisabled32.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ActualSizeEnabled32.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:ToggleToolButton x:Name="WholePageZoomButton" Margin="0,2,0,2" Template="{StaticResource TglBtn}" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/FitToWholePageDisabled32.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/FitToWholePageEnabled32.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:ToggleToolButton x:Name="PageWidthZoomButton" Margin="0,2,0,2" Template="{StaticResource TglBtn}" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/FitToPageWidthDisabled32.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/FitToPageWidthEnabled32.png" Stretch="None"/>
                                    </local:ToggleToolButton>

                                    <local:Separator Template="{StaticResource Sep}" Margin="2,4,2,4"/>

                                    <local:ToggleToolButton x:Name="PanToolButton" Margin="0,2,0,2" Template="{StaticResource TglBtn}" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/HandDisabled32.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/HandEnabled32.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:ToggleToolButton x:Name="ZoomOutToolButton" Margin="0,2,0,2" Template="{StaticResource TglBtn}" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ZoomOutDisabled32.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ZoomOutEnabled32.png" Stretch="None"/>
                                        <ToolTipService.ToolTip>
                                            <ToolTip Template="{StaticResource ToolTipTemplate}" Content="Zoom out"></ToolTip>
                                        </ToolTipService.ToolTip>
                                    </local:ToggleToolButton>
                                    <local:ToggleToolButton x:Name="ZoomInToolButton" Margin="0,2,0,2" Template="{StaticResource TglBtn}" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ZoomInDisabled32.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ZoomInEnabled32.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:ToggleToolButton x:Name="DynamicZoomToolButton" Margin="0,2,0,2" Template="{StaticResource TglBtn}" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ZoomDynamicDisabled32.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ZoomDynamicEnabled32.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:ToggleToolButton x:Name="RegionZoomToolButton" Margin="0,2,0,2" Template="{StaticResource TglBtn}" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/RegionZoomDisabled32.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/RegionZoomEnabled32.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:Separator Template="{StaticResource Sep}" Margin="2,4,2,4"/>
                                </StackPanel>

                                <TextBox x:Name="SearchTextBox" Grid.Column="1" VerticalAlignment="Center">
                                    <ToolTipService.ToolTip>
                                        <ToolTip Template="{StaticResource ToolTipTemplate}"/>
                                    </ToolTipService.ToolTip>
                                </TextBox>

                                <local:ToolBalloon x:Name="SearchNotFoundBalloon" CloseInterval="5000" Grid.Column="1" VerticalAlignment="Bottom" Margin="0,0,0,10"/>

                                <StackPanel Orientation="Horizontal" Grid.Column="2">
                                    <local:ToolButton x:Name="SearchButton" Margin="0,2,0,2" Template="{StaticResource ToolBtn}" VerticalAlignment="Center" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ZoomDisabled24.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ZoomEnabled24.png" Stretch="None"/>
                                    </local:ToolButton>
                                    <local:ToolButton x:Name="SearchPrevButton" Margin="0,2,0,2" Template="{StaticResource ToolBtn}" VerticalAlignment="Center" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/FindPreviousDisabled24.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/FindPreviousEnabled24.png" Stretch="None"/>
                                    </local:ToolButton>
                                    <local:ToolButton x:Name="SearchNextButton"  Margin="0,2,0,2" Template="{StaticResource ToolBtn}" VerticalAlignment="Center">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/FindNextDisabled24.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/FindNextEnabled24.png" Stretch="None"/>
                                    </local:ToolButton>
                                </StackPanel>
                            </Grid>

                            <!-- Main area-->
                            <Grid Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition x:Name="NavigationColumn" Width="Auto"/>
                                    <ColumnDefinition x:Name="DocumentElementColumn" Width="0" />
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <Border BorderThickness="1" BorderBrush="DarkGray" Grid.Column="3">
                                    <local:DocumentPresenter x:Name="DocumentPresenter"  Background="{TemplateBinding Background}"/>
                                </Border>


                                <Grid  Grid.Column="1" Margin="0 0 4 0" Background="{TemplateBinding NavigationPanelBackground}">
                                    <local:DocumentBookmark Background="{TemplateBinding DocumentElementBackground}" IsCollapse="{Binding Path=IsChecked,ElementName=BookmarkNavigationButton,Mode=TwoWay}" Title="Bookmarks" Margin="0 3 3 3"  x:Name="DocumentBookmarkElement" HorizontalAlignment="Stretch" Visibility="Collapsed"/>
                                    <local:DocumentThumbnails Background="{TemplateBinding DocumentElementBackground}" IsCollapse="{Binding Path=IsChecked,ElementName=ThumbnailsNavigationButton,Mode=TwoWay}" Title="Pages" Margin="0 3 3 3" x:Name="DocumentThumbnailsElement" HorizontalAlignment="Stretch" Visibility="Collapsed"/>
                                </Grid>

                                <Controls:GridSplitter Template="{StaticResource GridSplitter}" Grid.Column="1" x:Name="NavigationDocumentSpliter" Width="4" VerticalAlignment="Stretch" HorizontalAlignment="Right" Background="{TemplateBinding NavigationPanelBackground}" Visibility="Collapsed"/>

                                <StackPanel Width="{TemplateBinding NavigationPanelWidth}" x:Name="NavigationPanel" Orientation="Vertical" Grid.Column="0" Background="{TemplateBinding NavigationPanelBackground}" Opacity=".5" Visibility="{TemplateBinding VisibilityNavigationPanel}">
                                    <local:ToggleImageButton x:Name="ThumbnailsNavigationButton" Background="{TemplateBinding DocumentElementBackground}" Template="{StaticResource NavigationPanelButton}" Margin="0 2 0 0" ActiveImageSource="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/PagesEnabled24.png" NotActiveImageSource="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/PagesDisabled24.png"/>
                                    <local:ToggleImageButton x:Name="BookmarkNavigationButton" Background="{TemplateBinding DocumentElementBackground}" Template="{StaticResource NavigationPanelButton}" ActiveImageSource="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/BookmarkEnabled24.png" NotActiveImageSource="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/BookmarkDisabled24.png"/>
                                </StackPanel>
                            </Grid>

                            <!-- Status bar-->
                            <Grid Grid.Row="2" Visibility="{TemplateBinding StatusBarVisible}" Background="{TemplateBinding ToolBarBackground}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <StackPanel Orientation="Horizontal" Grid.Column="0">
                                    <local:ToolButton x:Name="GoToFirstPageButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonSquareFirstDisabled.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonSquareFirst.png" Stretch="None"/>
                                    </local:ToolButton>
                                    <local:ToolButton x:Name="GoToPrevPageButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonSquarePrevDisabled.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonSquarePrev.png" Stretch="None"/>
                                    </local:ToolButton>
                                    <TextBox x:Name="CurrentPageTextBox" Text="1" Width="30" Margin="0,2,0,2" HorizontalContentAlignment="Center">
                                        <ToolTipService.ToolTip>
                                            <ToolTip Template="{StaticResource ToolTipTemplate}"></ToolTip>
                                        </ToolTipService.ToolTip>
                                    </TextBox>
                                    <TextBlock Text=" of " Foreground="{TemplateBinding ToolBarForeground}" Margin="0,2,0,2" FontSize="12" VerticalAlignment="Center"/>
                                    <TextBlock x:Name="PageCountTextBlock" Text="100" Foreground="{TemplateBinding ToolBarForeground}" Margin="3,2,3,2" FontSize="12" VerticalAlignment="Center"/>
                                    <local:ToolButton x:Name="GoToNextPageButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonSquareNextDisabled.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonSquareNext.png" Stretch="None"/>
                                    </local:ToolButton>
                                    <local:ToolButton x:Name="GoToLastPageButton" Template="{StaticResource ToolBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonSquareLastDisabled.png" Stretch="None"/>
                                        </local:ToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ButtonSquareLast.png" Stretch="None"/>
                                    </local:ToolButton>
                                    <local:Separator Template="{StaticResource Sep}" Margin="2,4,2,4"/>
                                </StackPanel>
                                <TextBox Grid.Column="1" Visibility="Collapsed" />
                                <StackPanel Orientation="Horizontal" Grid.Column="2">
                                    <local:ToggleToolButton x:Name="SinglePageViewButton" Template="{StaticResource TglBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/WholePageDisabled.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/WholePageEnabled.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:ToggleToolButton x:Name="ContinuedPageViewButton" Template="{StaticResource TglBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ContinuedPageDisabled.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/ContinuedPageEnabled.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:ToggleToolButton x:Name="MultiPageViewButton" Template="{StaticResource TglBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <local:ToggleToolButton.DisabledContent>
                                            <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/MultiPageDisabled.png" Stretch="None"/>
                                        </local:ToggleToolButton.DisabledContent>
                                        <Image Source="/PerpetuumSoft.Reporting.Silverlight.Client;component/Resources/Images/MultiPageEnabled.png" Stretch="None"/>
                                    </local:ToggleToolButton>
                                    <local:Separator Template="{StaticResource Sep}" Margin="2,4,2,4"/>
                                    <TextBlock x:Name="CurrentZoomLabel" Text="100%" Foreground="{TemplateBinding ToolBarForeground}" Margin="0,2,5,2" FontSize="12" VerticalAlignment="Center"/>
                                    <Button x:Name="DecreaseZoomButton" Template="{StaticResource MinusBtn}" Margin="0,2,0,2" IsTabStop="False">
                                        <ToolTipService.ToolTip>
                                            <ToolTip Template="{StaticResource ToolTipTemplate}"/>
                                        </ToolTipService.ToolTip>
                                    </Button>
                                    <local:ToolSlider x:Name="ZoomSlider" Width="100" Margin="0,2,0,2" Style="{StaticResource ZoomSlider}"  IsTabStop="False"/>

                                    <Button x:Name="IncreaseZoomButton" Template="{StaticResource PlusBtn}" Margin="0,2,5,2" IsTabStop="False">
                                        <ToolTipService.ToolTip>
                                            <ToolTip Template="{StaticResource ToolTipTemplate}"/>
                                        </ToolTipService.ToolTip>

                                    </Button>
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <local:ReportViewer x:Name="reportViewer"
                        ServiceUrl="http://localhost:5555/ReportService.svc" 
                        ReportName="bookPriceList"
                        Style="{StaticResource CustomReportViewer}"
                        />
    </Grid>
</UserControl>
