<!--
/*
** Job Arranger Manager
** Copyright (C) 2012 FitechForce, Inc. All Rights Reserved.
** Copyright (C) 2013 Daiwa Institute of Research Business Innovation Ltd. All Rights Reserved.
**
**
** Licensed to the Apache Software Foundation (ASF) under one or more 
** contributor license agreements. See the NOTICE file distributed with
** this work for additional information regarding copyright ownership. 
** The ASF licenses this file to you under the Apache License, Version 2.0
** (the "License"); you may not use this file except in compliance with 
** the License. You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
**/
-->
<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:src="clr-namespace:jp.co.ftf.jobcontroller.JobController"
    xmlns:design="clr-namespace:jp.co.ftf.jobcontroller.JobController.Form.JobEdit">

    <Style TargetType="design:ArrowArc">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="design:ArrowArc">
                    <Canvas x:Name="RootElement">
                        <Path Stroke="{TemplateBinding Background}" StrokeDashArray="{TemplateBinding StrokeDashArray}" StrokeThickness="{TemplateBinding StrokeThickness}">
                            <Path.Data>
                                <PathGeometry>
                                    <PathFigure x:Name="LinePathFigureElement"  >
                                        <ArcSegment x:Name="LineElement"></ArcSegment>
                                    </PathFigure>
                                </PathGeometry>
                            </Path.Data>
                        </Path>
                        <Path Stroke="{TemplateBinding Background}" StrokeThickness="{TemplateBinding LineThickness}" Visibility="{TemplateBinding ArrowVisibility}">
                            <Path.Data>
                                <PathGeometry>
                                    <PathFigure x:Name="ArrowStartElement" >
                                        <PolyLineSegment x:Name="ArrowElement" ></PolyLineSegment>
                                    </PathFigure>
                                </PathGeometry>
                            </Path.Data>
                        </Path>
                        <Grid Name="CenterGridElement">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="1"></RowDefinition>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Canvas Grid.Column="0" Grid.Row="0" Name="ContentPresenterCanvasElement" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <ContentPresenter Name="ContentPresenterElement"></ContentPresenter>
                            </Canvas>
                        </Grid>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--<Style TargetType="TextBox">
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderBrush" Value="Black"/>
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" Value="#101010"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsReadOnly" Value="True">
                <Setter Property="Background" Value="White"/>
            </Trigger>
        </Style.Triggers>

    </Style>-->
    <Style x:Key="{x:Type TextBox}"  TargetType="{x:Type TextBoxBase}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="MinHeight" Value="20"/>
        <Setter Property="AllowDrop" Value="true"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Border    
          Name="Border"  
          CornerRadius="2"    
          Padding="2"  
          Background="White"  
          BorderBrush="#FF7F9DB9"  
          BorderThickness="1" >
                        <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="WhiteSmoke"/>
                            <Setter TargetName="Border" Property="BorderBrush" Value="#FF7F9DB9"/>
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type Button}">
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="Background" Value="White" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="True">
                <Setter Property="Background" Value="White" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="WhiteSmoke"/>
                <Setter Property="Foreground" Value="Black" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="Foreground" Value="Black" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="Black" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <!--
    <Style TargetType="{x:Type RadioButton}">
        <Setter Property="Foreground" Value="Black" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="Black" />
            </Trigger>
        </Style.Triggers>
    </Style>
-->

    <Style TargetType="{x:Type ComboBox}">
        <Setter Property="Foreground" Value="Black" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="Black" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="CenterDataListCellStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding  VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="HLeftVCenterDataListCellStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding  VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="VCenterDataListCellStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" VerticalAlignment="{TemplateBinding VerticalAlignment}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding  VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="IDDataListCellStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" VerticalAlignment="{TemplateBinding VerticalAlignment}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding  VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type DataGrid}">
        <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
    </Style>

    <Style x:Key="AutoHeightDataListCellStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="Height" Value="Auto" />
    </Style>

    <Style x:Key="AutoHeightDataListRowStyle" TargetType="{x:Type DataGridRow}">
        <Setter Property="Height" Value="Auto" />
    </Style>

    <Style x:Key="DisableDataGridCell" TargetType="{x:Type DataGridCell}">
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    </Style>
    <Style x:Key="VerticalScrollBarAutoDataGridCell" TargetType="{x:Type DataGridCell}">
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    </Style>

    <Style x:Key="DisableVCenterDataListCellStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" VerticalAlignment="{TemplateBinding VerticalAlignment}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding  VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DisableIDDataListCellStyle" TargetType="{x:Type DataGridCell}">
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" VerticalAlignment="{TemplateBinding VerticalAlignment}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding  VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="UnFocusableControlStyle" TargetType="Control">
        <Setter Property="Focusable" Value="False" />
    </Style>

    <Style x:Key="ValidHighlightDataListRowStyle" TargetType="{x:Type DataGridRow}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=valid_flag}" Value="1">
                <Setter Property="Background" Value="Aquamarine"/>
            </DataTrigger>
            <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="#FF316AC5"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <PathGeometry x:Key="TreeArrow">
        <PathGeometry.Figures>
            <PathFigureCollection>
                <PathFigure IsFilled="True"
                        StartPoint="0 0"
                        IsClosed="True">
                    <PathFigure.Segments>
                        <PathSegmentCollection>
                            <LineSegment Point="0 6"/>
                            <LineSegment Point="6 0"/>
                        </PathSegmentCollection>
                    </PathFigure.Segments>
                </PathFigure>
            </PathFigureCollection>
        </PathGeometry.Figures>
    </PathGeometry>

    <Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Width" Value="19"/>
        <Setter Property="Height" Value="13"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border Width="19" Height="13" Background="Transparent">
                        <Border SnapsToDevicePixels="true" Width="9" Height="9" BorderBrush="#FF7898B5" BorderThickness="1" CornerRadius="1">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
                                    <GradientStop Color="White" Offset=".2"/>
                                    <GradientStop Color="#FFC0B7A6" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Path Margin="1,1,1,1" x:Name="ExpandPath" Fill="Black" Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z"/>
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Data" TargetName="ExpandPath" Value="M 0 2 L 0 3 L 5 3 L 5 2 Z"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="TreeViewItemFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle Margin="0,0,0,0"
                 StrokeThickness="5"
                 Stroke="Black"
                 StrokeDashArray="1 2"
                 Opacity="0"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type TreeViewItem}"
       TargetType="{x:Type TreeViewItem}">
        <Setter Property="Background"
            Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment"
            Value="{Binding Path=HorizontalContentAlignment,RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="VerticalContentAlignment"
            Value="{Binding Path=VerticalContentAlignment,RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="Padding"
            Value="1,0,0,0"/>
        <Setter Property="Foreground"
            Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="FocusVisualStyle"
            Value="{StaticResource TreeViewItemFocusVisual}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeViewItem}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="19"
                                          Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <ToggleButton x:Name="Expander"
                                  Style="{StaticResource ExpandCollapseToggleStyle}"
                                  IsChecked="{Binding Path=IsExpanded,RelativeSource={RelativeSource TemplatedParent}}"
                                  ClickMode="Press"/>
                        <Border Name="Bd"
                            Grid.Column="1"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}"
                            SnapsToDevicePixels="true">
                            <ContentPresenter x:Name="PART_Header"
                                          ContentSource="Header"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Border>
                        <ItemsPresenter x:Name="ItemsHost"
                                    Grid.Row="1"
                                    Grid.Column="1"
                                    Grid.ColumnSpan="2"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded"
                             Value="false">
                            <Setter TargetName="ItemsHost"
                                Property="Visibility"
                                Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="HasItems"
                             Value="false">
                            <Setter TargetName="Expander"
                                Property="Visibility"
                                Value="Hidden"/>
                        </Trigger>
                        <Trigger Property="IsSelected"
                             Value="true">
                            <Setter TargetName="Bd"
                                Property="Background"
                                Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            <Setter Property="Foreground"
                                Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected"
                                       Value="true"/>
                                <Condition Property="IsSelectionActive"
                                       Value="false"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="Bd"
                                Property="Background"
                                Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            <Setter Property="Foreground"
                                Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
                        </MultiTrigger>
                        <Trigger Property="IsEnabled"
                             Value="false">
                            <Setter Property="Foreground"
                                Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="VirtualizingStackPanel.IsVirtualizing"
             Value="true">
                <Setter Property="ItemsPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <LinearGradientBrush x:Key="ListItemHoverFill" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFF1FBFF" Offset="0"/>
        <GradientStop Color="#FFD5F1FE" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ListItemSelectedFill" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFD9F4FF" Offset="0"/>
        <GradientStop Color="#FF9BDDFB" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ListItemSelectedInactiveFill" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFEEEDED" Offset="0"/>
        <GradientStop Color="#FFDDDDDD" Offset="1"/>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="ListItemSelectedHoverFill" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFEAF9FF" Offset="0"/>
        <GradientStop Color="#FFC9EDFD" Offset="1"/>
    </LinearGradientBrush>

    <Style x:Key="RadioButtonFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border>
                        <Rectangle 
            Margin="15,0,0,0"
            StrokeThickness="1"
            Stroke="#60000000"
            StrokeDashArray="1 2"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <LinearGradientBrush x:Key="NormalBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HorizontalNormalBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#CCC" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="LightBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HorizontalLightBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#FFF" Offset="0.0"/>
                <GradientStop Color="#AAA" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#BBB" Offset="0.0"/>
                <GradientStop Color="#EEE" Offset="0.1"/>
                <GradientStop Color="#EEE" Offset="0.9"/>
                <GradientStop Color="#FFF" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#222" />

    <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#DDD" />

    <!-- Border Brushes -->

    <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="HorizontalNormalBorderBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#CCC" Offset="0.0"/>
                <GradientStop Color="#444" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="DefaultedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#777" Offset="0.0"/>
                <GradientStop Color="#000" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientBrush.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="#444" Offset="0.0"/>
                <GradientStop Color="#888" Offset="1.0"/>
            </GradientStopCollection>
        </GradientBrush.GradientStops>
    </LinearGradientBrush>

    <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />

    <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />

    <SolidColorBrush x:Key="LightBorderBrush" Color="#AAA" />

    <!-- Miscellaneous Brushes -->
    <SolidColorBrush x:Key="GlyphBrush" Color="#444" />

    <SolidColorBrush x:Key="LightColorBrush" Color="#DDD" />

    <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle"    Value="{StaticResource RadioButtonFocusVisual}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <BulletDecorator Background="Transparent">
                        <BulletDecorator.Bullet>
                            <Grid Width="13" 
              Height="13" >
                                <Ellipse x:Name="Border"  
                Fill="{StaticResource NormalBrush}"
                StrokeThickness="1"
                Stroke="{StaticResource NormalBorderBrush}" />
                                <Ellipse x:Name="CheckMark"
                Margin="4"
                Fill="{StaticResource GlyphBrush}" />
                            </Grid>
                        </BulletDecorator.Bullet>
                        <ContentPresenter 
            Margin="4,0,0,0"
            VerticalAlignment="Center"
            HorizontalAlignment="Left"
            RecognizesAccessKey="True"/>
                    </BulletDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="false">
                            <Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource DarkBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource PressedBrush}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{StaticResource GlyphBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="Stroke" Value="#40000000" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <LinearGradientBrush x:Key="HorizontalBrush" StartPoint="0,0" EndPoint="1,0">
        <GradientStop Color="LightGreen" Offset="0.2" />
        <GradientStop Color="Blue" Offset="0.5" />
        <GradientStop Color="Red" Offset="1.0" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="VerticalBrush" StartPoint="0,1" EndPoint="0,0">
        <GradientStop Color="LightGreen" Offset="0.2" />
        <GradientStop Color="Blue" Offset="0.5" />
        <GradientStop Color="Red" Offset="1.0" />
    </LinearGradientBrush>

    <RadialGradientBrush x:Key="RoundButtonDefaultBrush">
        <GradientStop Color="#FF888888" Offset="0.027"/>
        <GradientStop Color="#FFFFFFFF" Offset="1"/>
        <GradientStop Color="#FF888888" Offset="0.728"/>
    </RadialGradientBrush>

    <RadialGradientBrush x:Key="RoundButtonPressedBrush">
        <GradientStop Color="#FFFFFFFF" Offset="0.027"/>
        <GradientStop Color="#FF888888" Offset="1"/>
        <GradientStop Color="#FFFFFFFF" Offset="0.728"/>
    </RadialGradientBrush>

    <RadialGradientBrush x:Key="RoundButtonMouseOverBrush">
        <GradientStop Color="#FF888888" Offset="0.027"/>
        <GradientStop Color="#FF52F4F2" Offset="1"/>
        <GradientStop Color="#FF888888" Offset="0.728"/>
    </RadialGradientBrush>

    <ControlTemplate x:Key="RoundButtonTemplate" TargetType="RepeatButton">
        <Grid>
            <Ellipse Name="PART_Ellipse" 
                         Width="18"
                         Height="18" 
                         Stroke="Black"
                         Fill="{StaticResource RoundButtonDefaultBrush}"/>
            <ContentPresenter Name="PART_ContentPresenter"  ContentSource="Content" Margin="0,0,0,0" 
                                  HorizontalAlignment="Center" 
                                  VerticalAlignment="Center"
                                  TextBlock.Foreground="White"
                                  TextBlock.FontSize="18"
                                  TextBlock.FontWeight="Bold"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="PART_Ellipse" Property="Fill" Value="{StaticResource RoundButtonMouseOverBrush}" />
                <Setter TargetName="PART_ContentPresenter" Property="TextBlock.Foreground" Value="#FF52F4F2" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
                <Setter TargetName="PART_Ellipse" Property="Fill" Value="{StaticResource RoundButtonPressedBrush}" />
                <Setter TargetName="PART_ContentPresenter" Property="TextBlock.Foreground" Value="Black" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <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>

    <Style x:Key="RoundButtonStyle" TargetType="RepeatButton">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template" Value="{StaticResource RoundButtonTemplate}" />
    </Style>

    <Style x:Key="SliderThumbStyle" TargetType="Thumb">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="false"/>
        <Setter Property="Height" Value="18"/>
        <Setter Property="Width" Value="8"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Rectangle  Stroke="Black"
                              StrokeThickness="1"
                              Name="Rectangle" 
                              Fill="#FF007BFF" />
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Rectangle" Property="Fill" Value="#FF007BFF"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Rectangle" Property="Fill" Value="Gray"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Slider">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Slider">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="auto" Name="row" />
                            <RowDefinition Height="auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="*" Name="column" />
                            <ColumnDefinition Width="auto" />
                        </Grid.ColumnDefinitions>

                        <RepeatButton Name="PART_DecreaseRepeatButton" 
                                  Grid.Row="1" Grid.Column="0" 
                                  Style="{StaticResource RoundButtonStyle}" 
                                  Content="-" Command="Slider.DecreaseSmall" />

                        <RepeatButton Name="PART_IncreaseRepeatButton" 
                                  Grid.Row="1" Grid.Column="2" 
                                  Style="{StaticResource RoundButtonStyle}" 
                                  Content="+" Command="Slider.IncreaseSmall" />

                        <Border Name="PART_Border" 
                            BorderBrush="Black" BorderThickness="1" 
                            Padding="2"
                            CornerRadius="5" 
                            Grid.Row="1" Grid.Column="1"
                            Width="{TemplateBinding Width}" 
                            Height="{TemplateBinding Height}"
                            Background="LightBlue"
                            HorizontalAlignment="Stretch"  
                            VerticalAlignment="Center" />

                        <Track Name="PART_Track" 
                               HorizontalAlignment="Stretch" 
                               VerticalAlignment="Center"   
                               Grid.Row="1" Grid.Column="1"
                               Width="{TemplateBinding Width}" 
                               Height="{TemplateBinding Height}">
                            <Track.DecreaseRepeatButton>
                                <RepeatButton Command="Slider.DecreaseLarge" 
                                          Style="{StaticResource SliderButtonStyle}" />
                            </Track.DecreaseRepeatButton>
                            <Track.Thumb>
                                <Thumb Style="{StaticResource SliderThumbStyle}" />
                            </Track.Thumb>
                            <Track.IncreaseRepeatButton>
                                <RepeatButton Command="Slider.IncreaseLarge" 
                                          Style="{StaticResource SliderButtonStyle}" />
                            </Track.IncreaseRepeatButton>
                        </Track>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="Orientation" Value="Vertical">
                            <Setter TargetName="PART_Border" Property="HorizontalAlignment" Value="Center" />
                            <Setter TargetName="PART_Border" Property="VerticalAlignment" Value="Stretch" />
                            <Setter TargetName="PART_Border" Property="Background" Value="{StaticResource VerticalBrush}" />
                            <Setter TargetName="PART_Track" Property="HorizontalAlignment" Value="Center" />
                            <Setter TargetName="PART_Track" Property="VerticalAlignment" Value="Stretch" />
                            <Setter TargetName="row" Property="Height" Value="*" />
                            <Setter TargetName="column" Property="Width" Value="auto" />
                            <Setter TargetName="PART_DecreaseRepeatButton" Property="Grid.Row" Value="2" />
                            <Setter TargetName="PART_DecreaseRepeatButton" Property="Grid.Column" Value="1" />
                            <Setter TargetName="PART_IncreaseRepeatButton" Property="Grid.Row" Value="0" />
                            <Setter TargetName="PART_IncreaseRepeatButton" Property="Grid.Column" Value="1" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <LinearGradientBrush x:Key="BackgroundBrush" EndPoint="0.5,0" StartPoint="0.5,1">
        <GradientStop Color="#FFa9cde7" Offset="0"/>
        <GradientStop Color="#FFe7f4fc" Offset="0.3"/>
        <GradientStop Color="#FFf2fafd" Offset="0.85"/>
        <GradientStop Color="#FFe4f6fa" Offset="1"/>
    </LinearGradientBrush>
    <Style x:Key="SelectableTextBlockLikeStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">

        <Setter Property="IsReadOnly" Value="True"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Background" Value="White"/>
        <Setter Property="Padding" Value="-2,0,0,0"/>
        <!-- The Padding -2,0,0,0 is required because the TextBox
                    seems to have an inherent "Padding" of about 2 pixels.
                    Without the Padding property,
                    the text seems to be 2 pixels to the left
                    compared to a TextBlock
                    -->
    </Style>
    <Style TargetType="TextBlock" x:Key="TextBlockServiceStyle">
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="src:TextBlockService.IsTextTrimmed" Value="True" />
                </MultiTrigger.Conditions>

                <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Tag}" />
            </MultiTrigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>