<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:vm="clr-namespace:WindowsPhone.Recipes.Push.Server.ViewModels"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
                    xmlns:behaviors="clr-namespace:WindowsPhone.Recipes.Push.Server.Behaviors"
                    xmlns:converters="clr-namespace:WindowsPhone.Recipes.Push.Server.Resources.Converters"
                    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
                    mc:Ignorable="d">
	
    <!-- Converters -->
    <converters:NullTileImageConverter x:Key="NullTileImageConverter" />
    <converters:UserFileImageConverter x:Key="UserFileImageConverter" />
    
	<!-- Brushes -->
	<SolidColorBrush x:Key="ViewBackgroundBrush" Color="#FF595959"/>
	<SolidColorBrush x:Key="SelectedViewBackgroundBrush" Color="Gray"/>
    <SolidColorBrush x:Key="ViewTextBrush" Color="#FFF3F3F3"/>
    <SolidColorBrush x:Key="TabControlNormalBorderBrush" Color="#8C8E94"/>
    <SolidColorBrush x:Key="StandardBorderBrush" Color="DarkGray"></SolidColorBrush>
    <SolidColorBrush x:Key="StandardBrush" Color="LightGray"></SolidColorBrush>
    <SolidColorBrush x:Key="PressedBrush" Color="Gray"></SolidColorBrush>
    <SolidColorBrush x:Key="HoverBrush" Color="#fefefe"></SolidColorBrush>
    <SolidColorBrush x:Key="GlyphBrush" Color="#333333"></SolidColorBrush>
    <SolidColorBrush x:Key="{x:Static DataGrid.FocusBorderBrushKey}" Color="#FF000000"/>
    
	<!-- Styles -->
    <Style x:Key="ViewBorderStyle" TargetType="{x:Type Border}">		
		<Setter Property="TextElement.Foreground" Value="{DynamicResource ViewTextBrush}" />
		<Setter Property="Background" Value="Transparent" />
	</Style>
	
    <Style x:Key="ImageListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
    	<Setter Property="Background" Value="Transparent"/>
    	<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    	<Setter Property="VerticalContentAlignment" Value="Stretch"/>
    	<Setter Property="Padding" Value="3"/>
    	<Setter Property="Template">
    		<Setter.Value>
    			<ControlTemplate TargetType="{x:Type ListBoxItem}">
    				<Border x:Name="Bd" CornerRadius="3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" RenderTransformOrigin="0.5,0.5">
    					<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    				</Border>
    				<ControlTemplate.Triggers>
    					<Trigger Property="IsSelected" Value="true">
    						<Setter Property="Background" TargetName="Bd" Value="AliceBlue"/>
    					</Trigger>
    					<MultiTrigger>
    						<MultiTrigger.Conditions>
    							<Condition Property="IsSelected" Value="true"/>
    							<Condition Property="Selector.IsSelectionActive" Value="false"/>
    						</MultiTrigger.Conditions>
    						<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
    					</MultiTrigger>
    					<Trigger Property="IsEnabled" Value="false">
    						<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
    					</Trigger>
    				</ControlTemplate.Triggers>
    			</ControlTemplate>
    		</Setter.Value>
    	</Setter>
    </Style>
    
    <Style x:Key="TabItemStyle" TargetType="{x:Type TabItem}">
    	<Setter Property="Foreground" Value="{DynamicResource ViewTextBrush}" />
    	<Setter Property="Background" Value="{DynamicResource ViewBackgroundBrush}" />
    	<Setter Property="Header" Value="{Binding DisplayName}" />
    	<Setter Property="Template" Value="{DynamicResource TabItemControlTemplate}"/>
    </Style>
    
    <ControlTemplate x:Key="TabItemControlTemplate" TargetType="{x:Type TabItem}">
    	<Grid SnapsToDevicePixels="True">
    		<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Padding="{TemplateBinding Padding}" Background="#FF404040">
    			<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
    		</Border>
    	</Grid>
    	<ControlTemplate.Triggers>
    		<Trigger Property="IsMouseOver" Value="True">
    			<Setter Property="Background" TargetName="Bd" Value="{DynamicResource SelectedViewBackgroundBrush}"/>
    		</Trigger>
    		<Trigger Property="IsSelected" Value="True">
    			<Setter Property="Panel.ZIndex" Value="1"/>
    			<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ViewBackgroundBrush}"/>
    		</Trigger>
    		<MultiTrigger>
    			<MultiTrigger.Conditions>
    				<Condition Property="IsSelected" Value="False"/>
    				<Condition Property="IsMouseOver" Value="True"/>
    			</MultiTrigger.Conditions>
    			<Setter Property="BorderBrush" TargetName="Bd" Value="#FF3C7FB1"/>
    		</MultiTrigger>
    		<Trigger Property="TabStripPlacement" Value="Bottom">
    			<Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1"/>
    		</Trigger>
    		<Trigger Property="TabStripPlacement" Value="Left">
    			<Setter Property="BorderThickness" TargetName="Bd" Value="1,1,0,1"/>
    		</Trigger>
    		<Trigger Property="TabStripPlacement" Value="Right">
    			<Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1"/>
    		</Trigger>
    		<MultiTrigger>
    			<MultiTrigger.Conditions>
    				<Condition Property="IsSelected" Value="True"/>
    				<Condition Property="TabStripPlacement" Value="Top"/>
    			</MultiTrigger.Conditions>
    			<Setter Property="Margin" Value="-2,-2,-2,-1"/>
    			<Setter Property="Margin" TargetName="Content" Value="0,0,0,1"/>
    		</MultiTrigger>
    		<MultiTrigger>
    			<MultiTrigger.Conditions>
    				<Condition Property="IsSelected" Value="True"/>
    				<Condition Property="TabStripPlacement" Value="Bottom"/>
    			</MultiTrigger.Conditions>
    			<Setter Property="Margin" Value="-2,-1,-2,-2"/>
    			<Setter Property="Margin" TargetName="Content" Value="0,1,0,0"/>
    		</MultiTrigger>
    		<MultiTrigger>
    			<MultiTrigger.Conditions>
    				<Condition Property="IsSelected" Value="True"/>
    				<Condition Property="TabStripPlacement" Value="Left"/>
    			</MultiTrigger.Conditions>
    			<Setter Property="Margin" Value="-2,-2,-1,-2"/>
    			<Setter Property="Margin" TargetName="Content" Value="0,0,1,0"/>
    		</MultiTrigger>
    		<MultiTrigger>
    			<MultiTrigger.Conditions>
    				<Condition Property="IsSelected" Value="True"/>
    				<Condition Property="TabStripPlacement" Value="Right"/>
    			</MultiTrigger.Conditions>
    			<Setter Property="Margin" Value="-1,-2,-2,-2"/>
    			<Setter Property="Margin" TargetName="Content" Value="1,0,0,0"/>
    		</MultiTrigger>
    		<Trigger Property="IsEnabled" Value="False">
    			<Setter Property="Background" TargetName="Bd" Value="#FFF4F4F4"/>
    			<Setter Property="BorderBrush" TargetName="Bd" Value="#FFC9C7BA"/>
    			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
    		</Trigger>
    	</ControlTemplate.Triggers>
    </ControlTemplate>

    <DataTemplate x:Key="TabContentTemplate">
        <Border BorderThickness="0">
            <DockPanel LastChildFill="True">
                <Border DockPanel.Dock="Right" BorderBrush="Black" BorderThickness="1" Width="150" Padding="4" Margin="2,0,0,0" Background="{DynamicResource ViewBackgroundBrush}">
                    <HeaderedContentControl Foreground="{DynamicResource ViewTextBrush}">
                        <HeaderedContentControl.Header>
                            <TextBlock Text="{Binding DisplayName}" FontWeight="Bold" />
                        </HeaderedContentControl.Header>
                        <TextBlock Text="{Binding Description}" TextWrapping="Wrap" FontSize="12" />
                    </HeaderedContentControl>
                </Border>
                <Border BorderBrush="Black" BorderThickness="1" Margin="0,0,2,0" Padding="4" Background="{DynamicResource ViewBackgroundBrush}">
                    <ContentControl Content="{Binding}" Foreground="{DynamicResource ViewTextBrush}" />
                </Border>
            </DockPanel>
        </Border>
    </DataTemplate>
    <ControlTemplate x:Key="CloseButtonControlTemplate" TargetType="{x:Type Button}">
    	<Grid x:Name="grid" Width="Auto" Height="Auto" Background="{x:Null}">
    		<Path Data="M8.75,0 L11.25,0 11.25,8.75 20,8.75 20,11.25 11.25,11.25 11.25,20 8.75,20 8.75,11.25 0,11.25 0,8.75 8.75,8.75 z" Fill="#FFF4F4F5" Height="Auto" Stretch="Fill" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
    			<Path.RenderTransform>
    				<TransformGroup>
    					<ScaleTransform/>
    					<SkewTransform/>
    					<RotateTransform Angle="45"/>
    					<TranslateTransform/>
    				</TransformGroup>
    			</Path.RenderTransform>
    		</Path>
    	</Grid>
    	<ControlTemplate.Triggers>
            
    		<Trigger Property="IsMouseOver" Value="True">
    			<Setter Property="Background" TargetName="grid">
    				<Setter.Value>
    					<RadialGradientBrush>
    						<GradientStop Color="#7CFFAF00" Offset="0"/>
    						<GradientStop Color="#1CE9A000" Offset="1"/>
    					</RadialGradientBrush>
    				</Setter.Value>
    			</Setter>
    		</Trigger>

            <Trigger Property="IsPressed" Value="True">
                <Setter Property="Background" TargetName="grid">
                    <Setter.Value>
                        <RadialGradientBrush>
                            <GradientStop Color="#BCFFB800" Offset="0.216"/>
                            <GradientStop Color="#80795800" Offset="1"/>
                        </RadialGradientBrush>
                    </Setter.Value>
                </Setter>
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>
    
	<Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
		<Setter Property="Width" Value="1"/>
		<Setter Property="Background" Value="DarkGray"/>
		<Setter Property="Cursor" Value="SizeWE"/>
	</Style>

	<Style x:Key="DataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
		<Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Padding" Value="4" />
        <Setter Property="MinWidth" Value="80" />
        <Setter Property="MinHeight" Value="30" />
		<Setter Property="Background" Value="{DynamicResource ViewBackgroundBrush}"/>
		<Setter Property="Foreground" Value="{DynamicResource ViewTextBrush}"/>
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                    <Grid>
                        <Microsoft_Windows_Themes:DataGridHeaderBorder BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" IsClickable="{TemplateBinding CanUserSort}" IsPressed="{TemplateBinding IsPressed}" IsHovered="{TemplateBinding IsMouseOver}" Padding="{TemplateBinding Padding}" SortDirection="{TemplateBinding SortDirection}" SeparatorBrush="{TemplateBinding SeparatorBrush}" SeparatorVisibility="{TemplateBinding SeparatorVisibility}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Microsoft_Windows_Themes:DataGridHeaderBorder>
                        <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Style="{StaticResource ColumnHeaderGripperStyle}"/>
                        <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Style="{StaticResource ColumnHeaderGripperStyle}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

	<Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type DataGridCell}">
					<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
						<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="BorderThickness" Value="0"/>
	</Style>    

    <Style x:Key="VerticalScrollBarThumbStyle" TargetType="{x:Type Thumb}">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Margin" Value="1,0,1,0" />
        <Setter Property="BorderBrush" Value="{StaticResource StandardBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Rectangle Width="8" Name="ellipse"  Stroke="{StaticResource StandardBorderBrush}"
                        Fill="{StaticResource StandardBrush}"
                               RadiusX="5" RadiusY="5"></Rectangle>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="ellipse" Property="Fill" Value="{StaticResource HoverBrush}"></Setter>
                        </Trigger>
                        <Trigger Property="IsDragging" Value="True">
                            <Setter TargetName="ellipse" Property="Fill" Value="{StaticResource PressedBrush}"></Setter>
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="HorizontalScrollBarThumbStyle" TargetType="{x:Type Thumb}">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Margin" Value="0,1,0,1" />
        <Setter Property="BorderBrush" Value="{StaticResource StandardBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Rectangle Height="8" Name="ellipse"  Stroke="{StaticResource StandardBorderBrush}"
                        Fill="{StaticResource StandardBrush}"
                               RadiusX="5" RadiusY="5"></Rectangle>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="ellipse" Property="Fill" Value="{StaticResource HoverBrush}"></Setter>
                        </Trigger>
                        <Trigger Property="IsDragging" Value="True">
                            <Setter TargetName="ellipse" Property="Fill" Value="{StaticResource PressedBrush}"></Setter>
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="LineButtonUpStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid Margin="1" Height="18" >
                        <Path Stretch="None" HorizontalAlignment="Center"
                              VerticalAlignment="Center" Name="Path"  Fill="{StaticResource StandardBrush}"
                                    Data="M 0 8 L 8 8 L 4 0 Z"></Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Path" Property="Fill"
                                    Value="{StaticResource HoverBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Path" Property="Fill"
                                    Value="{StaticResource PressedBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="LineButtonDownStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid Margin="1" Height="18" >
                        <Path Stretch="None" HorizontalAlignment="Center"
                              VerticalAlignment="Center" Name="Path"  Fill="{StaticResource StandardBrush}"
                                    Data="M 0 0 L 4 8 L 8 0 Z"></Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Path" Property="Fill"
                                    Value="{StaticResource HoverBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Path" Property="Fill"
                                    Value="{StaticResource PressedBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="LineButtonLeftStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid Margin="1" Width="18" >
                        <Path Stretch="None" HorizontalAlignment="Center"
                              VerticalAlignment="Center" Name="Path"  Fill="{StaticResource StandardBrush}"
                                    Data="M 0 0 L -8 4 L 0 8 Z"></Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Path" Property="Fill"
                                    Value="{StaticResource HoverBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Path" Property="Fill"
                                    Value="{StaticResource PressedBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="LineButtonRightStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Grid Margin="1" Width="18" >
                        <Path Stretch="None" HorizontalAlignment="Center"
                              VerticalAlignment="Center" Name="Path"  Fill="{StaticResource StandardBrush}"
                                    Data="M 0 0 L 8 4 L 0 8 Z"></Path>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Path" Property="Fill"
                                    Value="{StaticResource HoverBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Path" Property="Fill"
                                    Value="{StaticResource PressedBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="ScrollBarPageButtonStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="18"/>
                <RowDefinition Height="*"/>
                <RowDefinition MaxHeight="18"/>
            </Grid.RowDefinitions>
            <Grid.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Offset="0" Color="#4c4c4c"></GradientStop>
                    <GradientStop Offset="1" Color="#434343"></GradientStop>
                </LinearGradientBrush>
            </Grid.Background>
            <RepeatButton Grid.Row="0" Height="18"
                Style="{StaticResource LineButtonUpStyle}"
                Command="ScrollBar.LineUpCommand" >

            </RepeatButton>

            <Track Name="PART_Track" Grid.Row="1" IsDirectionReversed="True" >
                <Track.DecreaseRepeatButton>
                    <RepeatButton Command="ScrollBar.PageUpCommand"
                        Style="{StaticResource ScrollBarPageButtonStyle}">
                    </RepeatButton>
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource VerticalScrollBarThumbStyle}">
                    </Thumb>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Command="ScrollBar.PageDownCommand"
                        Style="{StaticResource ScrollBarPageButtonStyle}">
                    </RepeatButton>
                </Track.IncreaseRepeatButton>
            </Track>

            <RepeatButton Grid.Row="2" Height="18"
                Style="{StaticResource LineButtonDownStyle}"
                Command="ScrollBar.LineDownCommand">
            </RepeatButton>
        </Grid>
    </ControlTemplate>
    
    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="18"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition MaxWidth="18"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                    <GradientStop Offset="0" Color="#4c4c4c"></GradientStop>
                    <GradientStop Offset="1" Color="#434343"></GradientStop>
                </LinearGradientBrush>
            </Grid.Background>
            <RepeatButton Grid.Column="0" Width="18"
                Style="{StaticResource LineButtonLeftStyle}"
                Command="ScrollBar.LineLeftCommand" >
            </RepeatButton>

            <Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False" >
                <Track.DecreaseRepeatButton>
                    <RepeatButton Command="ScrollBar.PageLeftCommand"
                        Style="{StaticResource ScrollBarPageButtonStyle}">
                    </RepeatButton>
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource HorizontalScrollBarThumbStyle}">
                    </Thumb>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Command="ScrollBar.PageRightCommand"
                        Style="{StaticResource ScrollBarPageButtonStyle}">
                    </RepeatButton>
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton Grid.Column="2" Width="18"
                Style="{StaticResource LineButtonRightStyle}"
                Command="ScrollBar.LineRightCommand">
            </RepeatButton>
        </Grid>
    </ControlTemplate>
    
    <Style TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="18"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="18" />
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>