<ResourceDictionary
  x:Class="NuGet.PackageManagement.UI.SharedResources"
  x:ClassModifier="internal"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:nuget="clr-namespace:NuGet.PackageManagement.UI"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:ui="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Utilities"
  xmlns:vs="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0">
  <nuget:StyleKeyConverter
    x:Key="StyleKeyConverter" />

  <nuget:NuGetFrameworkToStringConverter
    x:Key="NuGetFrameworkToStringConverter" />
  <nuget:NuGetFrameworkToVisibilityConverter
    x:Key="NuGetFrameworkToVisibilityConverter" />
  <nuget:NullToVisibilityConverter
    x:Key="NullToVisibilityConverter" />
  <nuget:InverseNullToVisibilityConverter
    x:Key="InverseNullToVisibilityConverter" />
  <nuget:EnumerableToVisibilityConverter
    Inverted="true"
    x:Key="EmptyEnumerableToVisibilityConverter" />
  <nuget:EnumerableToVisibilityConverter
    x:Key="EnumerableToVisibilityConverter" />
  <nuget:InverseBooleanConverter
    x:Key="InverseBooleanConverter" />
  <nuget:BooleanToGridRowHeightConverter
    x:Key="BooleanToGridRowHeightConverter"/>
  <nuget:BooleanToGridRowHeightConverter
    Inverted="True"
    x:Key="InvertedBooleanToGridRowHeightConverter"/>
  <nuget:BooleanToVisibilityConverter
    x:Key="BooleanToVisibilityConverter" />
  <nuget:BooleanToVisibilityConverter
    Inverted="True"
    x:Key="InvertedBooleanToVisibilityConverter" />
  <nuget:BooleanToVisibilityConverter
    NonVisualState="Hidden"
    x:Key="NonVisualStateHiddenBooleanToVisibilityConverter" />
  <nuget:DownloadCountToVisibilityConverter
    x:Key="DownloadCountToVisibilityConverter" />
  <nuget:FontSizeConverter
    Scale="122"
    x:Key="Font122PercentSizeConverter" />
  <nuget:FontSizeConverter
    Scale="155"
    x:Key="Font155PercentSizeConverter" />
  <nuget:VersionToStringConverter
    x:Key="VersionToStringConverter" />
  <nuget:ProjectAndSolutionViewHeightConverter
    x:Key="ProjectAndSolutionViewHeightConverter" />
  <nuget:ProjectAndSolutionViewMinHeightConverter
    x:Key="ProjectAndSolutionViewMinHeightConverter"/>
  <nuget:RadioBoolToIntConverter
    x:Key="RadioBoolToIntConverter" />
  <nuget:SubstractionConverter
    x:Key="SubstractionConverter" />
  <nuget:AdditionConverter
    x:Key="AdditionConverter" />
  <ui:BrushToColorConverter
    x:Key="BrushToColorConverter" />

  <!-- Default styles -->
  <Style x:Key="ControlsFocusVisualStyle" TargetType="{x:Type Control}">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.UIText}}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate>
          <Rectangle x:Name="ControlFocusVisualRectangle"
            Stroke="{TemplateBinding Foreground}"
            StrokeThickness="1"
            StrokeDashArray="1 2"
            SnapsToDevicePixels="true"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="MarginFocusVisualStyle" TargetType="{x:Type Control}" BasedOn="{StaticResource ControlsFocusVisualStyle}">
    <Setter Property="Margin" Value="4"/>
  </Style>

  <Style x:Key="{x:Type Button}" TargetType="{x:Type Button}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource MarginFocusVisualStyle}"/>
    <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.ButtonTextStyleBrushKey}}"/>
    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static nuget:Brushes.ButtonBorderBrushKey}}"/>
    <Setter Property="Background" Value="{DynamicResource {x:Static nuget:Brushes.ButtonBackgroundStyleBrushKey}}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Padding" Value="10,1,10,1"/>
    <Setter Property="MinHeight" Value="23"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border
            x:Name="border"
            BorderBrush="{TemplateBinding BorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}"
            Background="{TemplateBinding Background}"
            SnapsToDevicePixels="True">
            <ContentPresenter
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              Margin="{TemplateBinding Padding}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
              RecognizesAccessKey="True"/>
          </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <Trigger Property="IsDefaulted" Value="true">
        <Setter Property="Background" Value="{DynamicResource {x:Static  nuget:Brushes.ButtonDefaultStyleBrushKey}}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static  nuget:Brushes.ButtonDefaultTextStyleBrushKey}}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static  nuget:Brushes.ButtonDefaultBorderStyleBrushKey}}"/>
      </Trigger>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" Value="{DynamicResource {x:Static nuget:Brushes.ButtonHoverStyleBrushKey}}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static nuget:Brushes.ButtonHoverBorderStyleBrushKey}}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.ButtonHoverTextStyleBrushKey}}"/>
      </Trigger>
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="Background" Value="{DynamicResource {x:Static nuget:Brushes.ButtonPressedStyleBrushKey}}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static nuget:Brushes.ButtonPressedBorderStyleBrushKey}}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.ButtonPressedTextStyleBrushKey}}"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Background" Value="{DynamicResource {x:Static nuget:Brushes.ButtonDisabledStyleBrushKey}}"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.ButtonDisabledTextStyleBrushKey}}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static nuget:Brushes.ButtonDisabledBorderStyleBrushKey}}"/>
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style x:Key="{x:Type ListBoxItem}" TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
  </Style>

  <Style x:Key="{x:Type TextBlock}" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource {x:Type TextBlock}}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
  </Style>

  <Style x:Key="{x:Type GridSplitter}" TargetType="{x:Type GridSplitter}" BasedOn="{StaticResource {x:Type GridSplitter}}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
  </Style>

  <Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Static nuget:Styles.ThemedComboStyleKey}}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
  </Style>

  <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
  </Style>

  <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource {x:Static nuget:Styles.ScrollBarStyleKey}}"/>

  <Style x:Key="{x:Type ScrollViewer}" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource {x:Static nuget:Styles.ScrollViewerStyleKey}}"/>

  <Style x:Key="TooltipStyle" TargetType="{x:Type TextBlock}">
    <Setter Property="TextWrapping" Value="Wrap" />
    <Setter Property="MaxWidth" Value="300" />
  </Style>

  <Style x:Key="ToolBarButtonStyle" BasedOn="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" TargetType="{x:Type Button}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}" />
  </Style>

  <Style x:Key="{x:Type CheckBox}" TargetType="{x:Type CheckBox}" BasedOn="{StaticResource {x:Type CheckBox}}">
    <Setter Property="FocusVisualStyle" Value="{DynamicResource ControlsFocusVisualStyle}"/>
    <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.UIText}}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type CheckBox}">
          <Grid x:Name="TemplateRoot">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto"/>
              <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid SnapsToDevicePixels="true" Width="16" Height="16" HorizontalAlignment="Left" VerticalAlignment="Top">
              <Border
                x:Name="CheckMarkBorder"
                Background="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundBrushKey}}"
                BorderBrush="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderBrushKey}}"
                BorderThickness="1"/>
              <Path
                x:Name="CheckMark"
                Data="M 6.22,11.02 C6.22,11.02 2.50,7.24 2.50,7.24 2.50,7.24 4.05,5.71 4.05,5.71 4.05,5.71 5.97,7.65 5.97,7.65 5.97,7.65 10.52,1.38 10.52,1.38 10.52,1.38 13.19,1.38 13.19,1.38 13.19,1.38 6.22,11.02 6.22,11.02 6.22,11.02 6.22,11.02 6.22,11.02 z"
                Stretch="Uniform" Margin="3,1,2,2" Visibility="Collapsed" Width="9" Height="8"
                Fill="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphBrushKey}}"/>
            </Grid>
            <ContentPresenter
              x:Name="CheckBoxContent"
              Grid.Column="1"
              Focusable="False"
              Margin="{TemplateBinding Padding}"
              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="HasContent" Value="true">
              <Setter Property="Padding" Value="6,1,0,0"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
              <Setter Property="Visibility" TargetName="CheckMark" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Background" TargetName="CheckMarkBorder" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundDisabledBrushKey}}"/>
              <Setter Property="BorderBrush" TargetName="CheckMarkBorder" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderDisabledBrushKey}}"/>
              <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxTextDisabledBrushKey}}"/>
              <Setter Property="Fill" TargetName="CheckMark"  Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphDisabledBrushKey}}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Background" TargetName="CheckMarkBorder" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundHoverBrushKey}}"/>
              <Setter Property="BorderBrush" TargetName="CheckMarkBorder" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderHoverBrushKey}}"/>
              <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxTextHoverBrushKey}}"/>
              <Setter Property="Fill" TargetName="CheckMark" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphHoverBrushKey}}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Background" TargetName="CheckMarkBorder" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundPressedBrushKey}}"/>
              <Setter Property="BorderBrush" TargetName="CheckMarkBorder" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderPressedBrushKey}}"/>
              <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxTextPressedBrushKey}}"/>
              <Setter Property="Fill" TargetName="CheckMark" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphPressedBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Type RadioButton}" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource {x:Static vs:VsResourceKeys.ThemedDialogRadioButtonStyleKey}}" />

  <Style x:Key="ExpanderRightHeaderStyle" 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>
                    <TransformGroup.Children>
                      <TransformCollection>
                        <RotateTransform Angle="-90"/>
                      </TransformCollection>
                    </TransformGroup.Children>
                  </TransformGroup>
                </Grid.LayoutTransform>
                <Ellipse
                    x:Name="circle"
                    Fill="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundBrushKey}}"
                    HorizontalAlignment="Center"
                    Height="19"
                    Stroke="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderBrushKey}}"
                    VerticalAlignment="Center"
                    Width="19"/>
                <Path
                    x:Name="arrow"
                    Data="M 1,1.5 L 4.5,5 L 8,1.5"
                    HorizontalAlignment="Center"
                    SnapsToDevicePixels="false"
                    Stroke="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphBrushKey}}"
                    StrokeThickness="2"
                    VerticalAlignment="Center"/>
              </Grid>
              <ContentPresenter 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="M 1,4.5  L 4.5,1  L 8,4.5"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderHoverBrushKey}}"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundHoverBrushKey}}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphHoverBrushKey}}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderPressedBrushKey}}"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundPressedBrushKey}}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphPressedBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ExpanderUpHeaderStyle" 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>
                    <TransformGroup.Children>
                      <TransformCollection>
                        <RotateTransform Angle="180"/>
                      </TransformCollection>
                    </TransformGroup.Children>
                  </TransformGroup>
                </Grid.LayoutTransform>
                <Ellipse
                    x:Name="circle"
                    Fill="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundBrushKey}}"
                    HorizontalAlignment="Center"
                    Height="19"
                    Stroke="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderBrushKey}}"
                    VerticalAlignment="Center"
                    Width="19"/>
                <Path
                    x:Name="arrow"
                    Data="M 1,1.5 L 4.5,5 L 8,1.5"
                    HorizontalAlignment="Center"
                    SnapsToDevicePixels="false"
                    Stroke="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphBrushKey}}"
                    StrokeThickness="2"
                    VerticalAlignment="Center"/>
              </Grid>
              <ContentPresenter Grid.Column="1" 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="M 1,4.5  L 4.5,1  L 8,4.5"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderHoverBrushKey}}"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundHoverBrushKey}}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphHoverBrushKey}}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderPressedBrushKey}}"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundPressedBrushKey}}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphPressedBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ExpanderLeftHeaderStyle" 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>
                    <TransformGroup.Children>
                      <TransformCollection>
                        <RotateTransform Angle="90"/>
                      </TransformCollection>
                    </TransformGroup.Children>
                  </TransformGroup>
                </Grid.LayoutTransform>
                <Ellipse
                    x:Name="circle"
                    Fill="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundBrushKey}}"
                    HorizontalAlignment="Center"
                    Height="19"
                    Stroke="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderBrushKey}}"
                    VerticalAlignment="Center"
                    Width="19"/>
                <Path
                    x:Name="arrow"
                    Data="M 1,1.5 L 4.5,5 L 8,1.5"
                    HorizontalAlignment="Center"
                    SnapsToDevicePixels="false"
                    Stroke="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphBrushKey}}"
                    StrokeThickness="2"
                    VerticalAlignment="Center"/>
              </Grid>
              <ContentPresenter 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="M 1,4.5  L 4.5,1  L 8,4.5"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderHoverBrushKey}}"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundHoverBrushKey}}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphHoverBrushKey}}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderPressedBrushKey}}"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundPressedBrushKey}}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphPressedBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="ExpanderDownHeaderStyle" 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="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundBrushKey}}"
                  HorizontalAlignment="Center"
                  Height="19"
                  Stroke="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderBrushKey}}"
                  VerticalAlignment="Center"
                  Width="19"/>
              <Path
                  x:Name="arrow"
                  Data="M 1,1.5 L 4.5,5 L 8,1.5"
                  HorizontalAlignment="Center"
                  SnapsToDevicePixels="false"
                  Stroke="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphBrushKey}}"
                  StrokeThickness="2"
                  VerticalAlignment="Center"/>
              <ContentPresenter Grid.Column="1" 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="M 1,4.5  L 4.5,1  L 8,4.5"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderHoverBrushKey}}"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundHoverBrushKey}}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphHoverBrushKey}}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
              <Setter Property="Stroke" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBorderPressedBrushKey}}"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxBackgroundPressedBrushKey}}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxGlyphPressedBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Type Expander}" TargetType="{x:Type Expander}">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="1"/>
    <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}"
                  ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                  Content="{TemplateBinding Header}"
                  DockPanel.Dock="Top"
                  Foreground="{TemplateBinding Foreground}"
                  FontWeight="{TemplateBinding FontWeight}"
                  FocusVisualStyle="{StaticResource ControlsFocusVisualStyle}"
                  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}"
                  Style="{StaticResource ExpanderDownHeaderStyle}"
                  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
              <ContentPresenter
                  x:Name="ExpandSite"
                  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" Value="{StaticResource ExpanderRightHeaderStyle}"/>
            </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" Value="{StaticResource ExpanderUpHeaderStyle}"/>
            </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" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.CheckBoxTextDisabledBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type ComboBoxItem}" x:Key="ComboBoxItemStyle">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.UIText}}"/>
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ComboBoxItem}">
          <Border x:Name="Bd"
                    SnapsToDevicePixels="true"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Padding="{TemplateBinding Padding}">
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
          </Border>
          <ControlTemplate.Triggers>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static nuget:Brushes.ContentMouseOverBrushKey}}" />
              <Setter Property="TextBlock.Foreground" Value="{DynamicResource {x:Static nuget:Brushes.ContentMouseOverTextBrushKey}}" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="Selector.IsSelectionActive" Value="False" />
                <Condition Property="IsSelected" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static nuget:Brushes.ContentInactiveSelectedBrushKey}}" />
              <Setter Property="TextBlock.Foreground" Value="{DynamicResource {x:Static nuget:Brushes.ContentInactiveSelectedTextBrushKey}}" />
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="Selector.IsSelectionActive" Value="True" />
                <Condition Property="IsSelected" Value="True" />
              </MultiTrigger.Conditions>
              <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static nuget:Brushes.ContentSelectedBrushKey}}" />
              <Setter Property="TextBlock.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static nuget:Brushes.ContentSelectedTextBrushKey}}" />
            </MultiTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- In order to create a TextBlock like element, but with selectable text use:
    <TextBox Style="{DynamicResource SelectableTextBlockStyle}" />

    Thanks to juanjo.arana for his style, which we tweaked: http://stackoverflow.com/questions/136435/any-way-to-make-a-wpf-textblock-selectable
  -->
  <Style x:Key="SelectableTextBlockStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
    <Setter Property="IsReadOnly" Value="True"/>
    <Setter Property="IsTabStop" Value="False"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.UIText}}"/>
    <Setter Property="Padding" Value="-2,0,-2,0"/>
    <Style.Triggers>
      <MultiTrigger>
        <MultiTrigger.Conditions>
          <Condition Property="IsMouseOver" Value="False" />
          <Condition Property="IsFocused" Value="False" />
        </MultiTrigger.Conditions>
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type TextBox}">
              <TextBlock Text="{TemplateBinding Text}"
                             Foreground="{DynamicResource {x:Static nuget:Brushes.UIText}}"
                             Background="{TemplateBinding Background}"
                             FontSize="{TemplateBinding FontSize}"
                             FontStyle="{TemplateBinding FontStyle}"
                             FontFamily="{TemplateBinding FontFamily}"
                             FontWeight="{TemplateBinding FontWeight}"
                             TextWrapping="{TemplateBinding TextWrapping}"
                             TextTrimming="CharacterEllipsis"
                             Padding="0,0,0,0" />
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </MultiTrigger>
    </Style.Triggers>
  </Style>

  <Style
    TargetType="{x:Type Hyperlink}"
    x:Key="HyperlinkStyle">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.ControlLinkTextKey}}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
    <Style.Triggers>
      <Trigger
        Property="IsMouseOver"
        Value="True">
        <Setter
          Property="Foreground"
          Value="{DynamicResource {x:Static nuget:Brushes.ControlLinkTextHoverKey}}" />
      </Trigger>

      <Trigger
        Property="IsMouseOver"
        Value="False">
        <Setter
          Property="TextBlock.TextDecorations"
          Value="{x:Null}" />
      </Trigger>

      <Trigger
        Property="NavigateUri"
        Value="{x:Null}">
        <Setter
          Property="Foreground"
          Value="{DynamicResource {x:Static nuget:Brushes.WindowTextKey}}" />
        <Setter
          Property="TextBlock.TextDecorations"
          Value="{x:Null}" />
        <Setter
          Property="IsEnabled"
          Value="False" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style
    TargetType="{x:Type Hyperlink}"
    x:Key="WindowHyperlinkStyle">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static nuget:Brushes.ControlLinkTextKey}}" />
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
    <Style.Triggers>
      <Trigger
        Property="IsMouseOver"
        Value="True">
        <Setter
          Property="Foreground"
          Value="{DynamicResource {x:Static nuget:Brushes.ControlLinkTextHoverKey}}" />
      </Trigger>

      <Trigger
        Property="IsMouseOver"
        Value="False">
        <Setter
          Property="TextBlock.TextDecorations"
          Value="{x:Null}" />
      </Trigger>
    </Style.Triggers>
  </Style>

  <Style
    x:Key="PackageIconImageStyle"
    TargetType="{x:Type Image}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ControlsFocusVisualStyle}"/>
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="Height" Value="32" />
    <Setter Property="Width" Value="32" />
    <Setter Property="Source" Value="{Binding Path='DataContext.IconBitmap',RelativeSource='{RelativeSource Self}'}" />
  </Style>
</ResourceDictionary>
