<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:System="clr-namespace:System;assembly=mscorlib">

  <!--Basic GridSpitter-->
  <Style TargetType="{x:Type GridSplitter}">
    <Setter Property="Background" Value="{DynamicResource GridSplitter.Background}" />
  </Style>

  <!--Basic Button-->
  <Style TargetType="{x:Type Button}">
  </Style>

  <!--Basic CheckBox-->
  <Style TargetType="{x:Type CheckBox}">
    <Setter Property="Foreground"
        Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
  </Style>

  <!--Basic TextBox-->
  <Style TargetType="{x:Type TextBox}">
  </Style>

  <!--Basic Label-->
  <Style TargetType="{x:Type Label}">
    <Setter Property="Foreground"
        Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
  </Style>

  <!--Basic ComboBox-->
  <Style TargetType="{x:Type ComboBox}">
  </Style>

  <!--Basic TabControl-->
  <!-- See TabControlStyle.xaml -->

  <!--Basic GroupBox-->
  <Style TargetType="{x:Type GroupBox}"/>

  <!--Basic Image-->
  <Style TargetType="{x:Type Image}"/>

  <!--Basic TextBlock-->
  <Style TargetType="{x:Type TextBlock}"/>

  <!--Basic ListViewItem-->
  <Style TargetType="{x:Type ListBoxItem}">
    <Style.Resources>
      <!--SelectedItem without focus-->
      <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{x:Static SystemColors.HighlightColor}"/>
    </Style.Resources>
  </Style>

  <!--Basic Expander-->
  <Style TargetType="{x:Type Expander}">
    <Setter Property="Foreground" Value="{DynamicResource Window.Foreground}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="True">
            <DockPanel>
              <ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" DockPanel.Dock="Top" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                <ToggleButton.FocusVisualStyle>
                  <Style>
                    <Setter Property="Control.Template">
                      <Setter.Value>
                        <ControlTemplate>
                          <Border>
                            <Rectangle Margin="0" SnapsToDevicePixels="True" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2"/>
                          </Border>
                        </ControlTemplate>
                      </Setter.Value>
                    </Setter>
                  </Style>
                </ToggleButton.FocusVisualStyle>
                <ToggleButton.Style>
                  <Style TargetType="{x:Type ToggleButton}">
                    <Setter Property="Template">
                      <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ToggleButton}">
                          <Border Padding="{TemplateBinding Padding}">
                            <Grid Background="Transparent" SnapsToDevicePixels="False">
                              <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="19"/>
                                <ColumnDefinition Width="*"/>
                              </Grid.ColumnDefinitions>
                              <Ellipse x:Name="circle" Fill="Transparent" HorizontalAlignment="Center" Height="19" Stroke="{TemplateBinding Foreground}" VerticalAlignment="Center" Width="19"/>
                              <Path x:Name="arrow" Data="M1,1.5L4.5,5 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="False" Stroke="{TemplateBinding Foreground}" StrokeThickness="2" VerticalAlignment="Center"/>
                              <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
                            </Grid>
                          </Border>
                          <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                              <Setter Property="Data" TargetName="arrow" Value="M1,4.5L4.5,1 8,4.5"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource Window.Foreground}"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource Window.Foreground}"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                              <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                              <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                              <Setter Property="Stroke" TargetName="circle" Value="DarkGray"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF666666"/>
                            </Trigger>
                          </ControlTemplate.Triggers>
                        </ControlTemplate>
                      </Setter.Value>
                    </Setter>
                  </Style>
                </ToggleButton.Style>
              </ToggleButton>
              <ContentPresenter x:Name="ExpandSite" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" DockPanel.Dock="Bottom" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </DockPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsExpanded" Value="True">
              <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
            </Trigger>
            <Trigger Property="ExpandDirection" Value="Right">
              <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
              <Setter Property="Style" TargetName="HeaderSite">
                <Setter.Value>
                  <Style TargetType="{x:Type ToggleButton}">
                    <Setter Property="Template">
                      <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ToggleButton}">
                          <Border Padding="{TemplateBinding Padding}">
                            <Grid Background="Transparent" SnapsToDevicePixels="False">
                              <Grid.RowDefinitions>
                                <RowDefinition Height="19"/>
                                <RowDefinition Height="*"/>
                              </Grid.RowDefinitions>
                              <Grid>
                                <Grid.LayoutTransform>
                                  <TransformGroup>
                                    <RotateTransform Angle="-90"/>
                                  </TransformGroup>
                                </Grid.LayoutTransform>
                                <Ellipse x:Name="circle" Fill="Transparent" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                <Path x:Name="arrow" Data="M1,1.5L4.5,5 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="False" Stroke="#FF666666" StrokeThickness="2" VerticalAlignment="Center"/>
                              </Grid>
                              <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Top"/>
                            </Grid>
                          </Border>
                          <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                              <Setter Property="Data" TargetName="arrow" Value="M1,4.5L4.5,1 8,4.5"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                              <Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF222222"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                              <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                              <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                              <Setter Property="Stroke" TargetName="circle" Value="DarkGray"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF666666"/>
                            </Trigger>
                          </ControlTemplate.Triggers>
                        </ControlTemplate>
                      </Setter.Value>
                    </Setter>
                  </Style>
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="ExpandDirection" Value="Up">
              <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
              <Setter Property="Style" TargetName="HeaderSite">
                <Setter.Value>
                  <Style TargetType="{x:Type ToggleButton}">
                    <Setter Property="Template">
                      <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ToggleButton}">
                          <Border Padding="{TemplateBinding Padding}">
                            <Grid Background="Transparent" SnapsToDevicePixels="False">
                              <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="19"/>
                                <ColumnDefinition Width="*"/>
                              </Grid.ColumnDefinitions>
                              <Grid>
                                <Grid.LayoutTransform>
                                  <TransformGroup>
                                    <RotateTransform Angle="180"/>
                                  </TransformGroup>
                                </Grid.LayoutTransform>
                                <Ellipse x:Name="circle" Fill="Transparent" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                <Path x:Name="arrow" Data="M1,1.5L4.5,5 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="False" Stroke="#FF666666" StrokeThickness="2" VerticalAlignment="Center"/>
                              </Grid>
                              <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
                            </Grid>
                          </Border>
                          <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                              <Setter Property="Data" TargetName="arrow" Value="M1,4.5L4.5,1 8,4.5"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                              <Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF222222"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                              <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                              <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                              <Setter Property="Stroke" TargetName="circle" Value="DarkGray"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF666666"/>
                            </Trigger>
                          </ControlTemplate.Triggers>
                        </ControlTemplate>
                      </Setter.Value>
                    </Setter>
                  </Style>
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="ExpandDirection" Value="Left">
              <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
              <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
              <Setter Property="Style" TargetName="HeaderSite">
                <Setter.Value>
                  <Style TargetType="{x:Type ToggleButton}">
                    <Setter Property="Template">
                      <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ToggleButton}">
                          <Border Padding="{TemplateBinding Padding}">
                            <Grid Background="Transparent" SnapsToDevicePixels="False">
                              <Grid.RowDefinitions>
                                <RowDefinition Height="19"/>
                                <RowDefinition Height="*"/>
                              </Grid.RowDefinitions>
                              <Grid>
                                <Grid.LayoutTransform>
                                  <TransformGroup>
                                    <RotateTransform Angle="90"/>
                                  </TransformGroup>
                                </Grid.LayoutTransform>
                                <Ellipse x:Name="circle" Fill="Transparent" HorizontalAlignment="Center" Height="19" Stroke="DarkGray" VerticalAlignment="Center" Width="19"/>
                                <Path x:Name="arrow" Data="M1,1.5L4.5,5 8,1.5" HorizontalAlignment="Center" SnapsToDevicePixels="False" Stroke="#FF666666" StrokeThickness="2" VerticalAlignment="Center"/>
                              </Grid>
                              <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="Center" Margin="0,4,0,0" Grid.Row="1" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Top"/>
                            </Grid>
                          </Border>
                          <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                              <Setter Property="Data" TargetName="arrow" Value="M1,4.5L4.5,1 8,4.5"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                              <Setter Property="Stroke" TargetName="circle" Value="#FF3C7FB1"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF222222"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                              <Setter Property="Stroke" TargetName="circle" Value="#FF526C7B"/>
                              <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF003366"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                              <Setter Property="Stroke" TargetName="circle" Value="DarkGray"/>
                              <Setter Property="Fill" TargetName="circle" Value="Transparent"/>
                              <Setter Property="Stroke" TargetName="arrow" Value="#FF666666"/>
                            </Trigger>
                          </ControlTemplate.Triggers>
                        </ControlTemplate>
                      </Setter.Value>
                    </Setter>
                  </Style>
                </Setter.Value>
              </Setter>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

    <!--Basic ToolTip-->
    <Style TargetType="{x:Type ToolTip}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Value="{x:Null}">
                <Setter Property="Visibility" Value="Collapsed" />
            </DataTrigger>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Content}" Value="">
                <Setter Property="Visibility" Value="Collapsed" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>
