<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ribbon="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon"
                    xmlns:mucc="clr-namespace:Microsoft.Uii.Csr;assembly=Microsoft.Uii.Csr.Core"
                    xmlns:control="clr-namespace:Dynamics.Controls;assembly=Dynamics"
                    xmlns:themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Luna">
  <!-- General -->
  <SolidColorBrush x:Key="WindowBackgroundBrush" Color="Transparent"  />
  <LinearGradientBrush x:Key="WindowHeaderStyle" StartPoint="1,0" EndPoint="1,1">
    <GradientStop Color="#FFEBEBEB" Offset="0"/>
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="WindowBackgroundStyle" StartPoint="1,0" EndPoint="1,1">
    <GradientStop Color="#FFEBEBEB" Offset="0"/>
  </LinearGradientBrush>
  <SolidColorBrush x:Key="ToolBarButtonHoverBorder" Color="#0A246A"/>
  <SolidColorBrush x:Key="ToolBarButtonPressedBorder" Color="#0A246A"/>
  <SolidColorBrush x:Key="ToolBarButtonPressed" Color="#8592B5"/>
  <SolidColorBrush x:Key="ToolBarButtonHover" Color="#B6BDD2"/>
  <SolidColorBrush x:Key="ToolBarGripper" Color="#A0A0A0"/>
  <SolidColorBrush x:Key="ToolBarMenuBorder" Color="#666666"/>
  <SolidColorBrush x:Key="ToolBarSubMenuBackground" Color="#F9F8F7"/>
  <SolidColorBrush x:Key="GlyphBrush" Color="#444"/>
  <SolidColorBrush x:Key="SelectedBackgroundBrush" Color="#DDD"/>
  <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888"/>
  <SolidColorBrush x:Key="ButtonBorder" Color="#FF003C74"/>
  <LinearGradientBrush x:Key="ToolBarHorizontalBackground" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#E2E0DB" Offset="0"/>
    <GradientStop Color="#EAE8E4" Offset="0.5"/>
    <GradientStop Color="#D5D2CA" Offset="0.9"/>
    <GradientStop Color="#DBD8D1" Offset="1"/>
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ToolBarToggleButtonVerticalBackground" EndPoint="1,0" StartPoint="0,0">
    <GradientStop Color="#E6E6E6" Offset="0"/>
    <GradientStop Color="#D2D2D2" Offset="0.5"/>
    <GradientStop Color="#808080" Offset="1"/>
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ToolBarVerticalBackground" EndPoint="1,0" StartPoint="0,0">
    <GradientStop Color="#E2E0DB" Offset="0"/>
    <GradientStop Color="#EAE8E4" Offset="0.5"/>
    <GradientStop Color="#D5D2CA" Offset="0.9"/>
    <GradientStop Color="#DBD8D1" Offset="1"/>
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ToolBarToggleButtonHorizontalBackground" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#E6E6E6" Offset="0"/>
    <GradientStop Color="#D2D2D2" Offset="0.5"/>
    <GradientStop Color="#808080" Offset="1"/>
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ExpanderArrowHoverFill" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Offset="0" Color="#FFFFFFFF" />
    <GradientStop Offset="0.1" Color="#FFDFEDF9" />
    <GradientStop Offset="0.47" Color="#FF3086E1" />
    <GradientStop Offset="0.47" Color="#FF003B91" />
    <GradientStop Offset="0.7" Color="#FF1793EF" />
    <GradientStop Offset="0.85" Color="#FF5AD4FF" />
    <GradientStop Offset="0.95" Color="#FFBDFFFF" />
    <GradientStop Offset="1" Color="#FFFFFFFF" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ExpanderArrowPressedFill" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Offset="0" Color="#FFFFFFFF" />
    <GradientStop Offset="1" Color="#FFFFFFFF" />
    <GradientStop Offset="0" Color="#FFC0D2F5" />
    <GradientStop Offset="0.47" Color="#FF5E7A9C" />
    <GradientStop Offset="0.47" Color="#FF00062D" />
    <GradientStop Offset="0.7" Color="#FF005F9F" />
    <GradientStop Offset="0.85" Color="#FF1FA4E2" />
    <GradientStop Offset="0.95" Color="#FF61DAFF" />
    <GradientStop Offset="1" Color="#FF48CFFF" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ExpanderArrowFill" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Offset="0" Color="#FFFFFFFF" />
    <GradientStop Offset="0.1" Color="#FFCCD4E9" />
    <GradientStop Offset="0.47" Color="#FF4881D2" />
    <GradientStop Offset="0.47" Color="#FF001A5A" />
    <GradientStop Offset="0.7" Color="#FF007BD6" />
    <GradientStop Offset="0.85" Color="#FF54DAFF" />
    <GradientStop Offset="0.95" Color="#FF86FFFF" />
    <GradientStop Offset="1" Color="#FFFFFFFF" />
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="NormalBrush" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#EEE" Offset="0.0"/>
    <GradientStop Color="#CCC" Offset="1.0"/>
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="NormalBorderBrush" EndPoint="0,1" StartPoint="0,0">
    <GradientStop Color="#CCC" Offset="0.0"/>
    <GradientStop Color="#444" Offset="1.0"/>
  </LinearGradientBrush>
  <LinearGradientBrush x:Key="ButtonNormalBackgroundFill" EndPoint="0.5,1" StartPoint="0.5,0">
    <GradientStop Color="#FFFFFFFF" Offset="0"/>
    <GradientStop Color="#FFF0F0EA" Offset="0.9"/>
  </LinearGradientBrush>

  <!-- Window -->
  <Style x:Key="FloatingWindow" TargetType="{x:Type Window}" BasedOn="{StaticResource {x:Type Window}}">
    <Setter Property="Background" Value="{DynamicResource WindowHeaderStyle}"/>
  </Style>
  <Style x:Key="ToolWindow" TargetType="{x:Type Window}" BasedOn="{StaticResource {x:Type Window}}">
    <Setter Property="Background" Value="{DynamicResource WindowHeaderStyle}"/>
  </Style>
  <Style x:Key="MainWindow" TargetType="{x:Type Window}" BasedOn="{StaticResource {x:Type Window}}">
    <Setter Property="Background" Value="{DynamicResource WindowHeaderStyle}"/>
    <Setter Property="MinWidth" Value="1024"/>
    <Setter Property="MinHeight" Value="768"/>
    <Setter Property="Visibility" Value="Visible"/>
    <Setter Property="WindowState" Value="Normal"/>
    <Setter Property="SizeToContent" Value="Manual"/>
    <Setter Property="Title" Value="Unified Service Desk"/>
    <Setter Property="Icon" Value="/AgentDesktop;component/imageResources/DynamicsIcon.png"/>
  </Style>

  <!-- Agent Scripting -->
  <Style x:Key="AgentScriptTextLabel" TargetType="{x:Type Label}">
    <Setter Property="Visibility" Value="Collapsed"/>
    <Setter Property="FontWeight" Value="Bold"/>
  </Style>
  <Style x:Key="AgentScriptText" TargetType="{x:Type TextBlock}">
    <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
    <Setter Property="FontSize" Value="12"/>
    <Setter Property="Margin" Value="5,5,0,5"/>
  </Style>
  <Style x:Key="AgentScriptInstructionsLabel" TargetType="{x:Type Label}">
    <Setter Property="Visibility" Value="Collapsed"/>
    <Setter Property="FontWeight" Value="Bold"/>
  </Style>
  <Style x:Key="AgentScriptInstructions" TargetType="{x:Type TextBlock}">
    <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
    <Setter Property="FontSize" Value="10"/>
    <Setter Property="Margin" Value="5,5,0,5"/>
  </Style>
  <Style x:Key="AgentScriptAnswer" TargetType="{x:Type Button}" >
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="Padding" Value="2"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Margin" Value="10, 0, 0, 0"/>
    <Setter Property="HorizontalContentAlignment" Value="Left"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonHoverBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonHoverBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonPressedBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonPressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="AgentScriptHistory" TargetType="{x:Type ComboBox}">
  </Style>

  <!-- USD Tabs -->
  <Style x:Key="USDTabPanelStyle" TargetType="{x:Type Grid}">
    <Setter Property="Focusable" Value="True"/>
    <Setter Property="ClipToBounds" Value="False"/>
    <Setter Property="Margin" Value="0"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
  </Style>
  <Style x:Key="USDTab" TargetType="{x:Type TabItem}">
    <Setter Property="Focusable" Value="True"/>
    <Setter Property="ClipToBounds" Value="False"/>
    <Setter Property="Margin" Value="0"/>
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="FontFamily" Value="Tahoma"/>
    <Setter Property="FontSize" Value="11"/>
    <Setter Property="Foreground" Value="Black" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TabItem}">
          <ControlTemplate.Resources>
          </ControlTemplate.Resources>
          <Grid>
            <Border
              x:Name="Border"
              BorderBrush="FloralWhite"
              BorderThickness="1,1,1,0"
              CornerRadius="10,0,10,0" >
              <Border.Background>
                <LinearGradientBrush EndPoint="1,0" StartPoint="1,1">
                  <GradientStop Color="#FFEBEBEB" Offset="0"/>
                  <GradientStop Color="#FFEBEBEB" Offset="1"/>
                </LinearGradientBrush>
              </Border.Background>
              <ContentPresenter x:Name="ContentSite"
                          VerticalAlignment="Top"
                          HorizontalAlignment="Center"
                          ContentSource="Header"
                          Margin="5,5,5,5">
                <ContentPresenter.Resources>
                </ContentPresenter.Resources>
              </ContentPresenter>
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsSelected" Value="True">
              <Setter TargetName="Border" Property="Background" Value="White" />
              <Setter Property="FontWeight" Value="Bold"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type TabControl}">
    <Setter Property="Background" Value="Transparent"></Setter>
  </Style>
  <Style x:Key="USDDebuggerTab" TargetType="{x:Type TabItem}" BasedOn="{StaticResource USDTab}">
    <Setter Property="Background" Value="Transparent"></Setter>
  </Style>

    <!-- Toolbar -->
  <Style x:Key="ToolBarButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="Padding" Value="2"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonHoverBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonHoverBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonPressedBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonPressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="{x:Type ToolBarTray}">
    <Setter Property="IsLocked" Value="true"/>
    <Setter Property="Background" Value="Transparent" />
  </Style>
  <Style x:Key="ToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="{StaticResource ToolBarToggleButtonVerticalBackground}"/>
    <Setter Property="MinHeight" Value="0"/>
    <Setter Property="MinWidth" Value="0"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="0,0,3,3" SnapsToDevicePixels="true">
            <Canvas HorizontalAlignment="Right" Height="6" Margin="2,7,2,2" SnapsToDevicePixels="true" VerticalAlignment="Bottom" Width="7">
              <Path Data="M 1.5 1 L 1.5 6" Stroke="White"/>
              <Path Data="M 0.5 0 L 0.5 5" Stroke="{TemplateBinding Foreground}"/>
              <Path Data="M 3.5 0.5 L 7 3.5 L 4 6.5 Z" Fill="White"/>
              <Path Data="M 3 -0.5 L 6 2.5 L 3 5.5 Z" Fill="{TemplateBinding Foreground}"/>
            </Canvas>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource ToolBarGripper}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
      </DataTrigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Background" Value="{StaticResource ToolBarToggleButtonHorizontalBackground}"/>
    <Setter Property="MinHeight" Value="0"/>
    <Setter Property="MinWidth" Value="0"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border x:Name="Bd" Background="{TemplateBinding Background}" CornerRadius="0,3,3,0" SnapsToDevicePixels="true">
            <Canvas HorizontalAlignment="Right" Height="7" Margin="7,2,2,2" SnapsToDevicePixels="true" VerticalAlignment="Bottom" Width="6">
              <Path Data="M 1 1.5 L 6 1.5" Stroke="White"/>
              <Path Data="M 0 0.5 L 5 0.5" Stroke="{TemplateBinding Foreground}"/>
              <Path Data="M 0.5 4 L 6.5 4 L 3.5 7 Z" Fill="White"/>
              <Path Data="M -0.5 3 L 5.5 3 L 2.5 6 Z" Fill="{TemplateBinding Foreground}"/>
            </Canvas>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{StaticResource ToolBarGripper}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
      </DataTrigger>
    </Style.Triggers>
  </Style>
  <Style x:Key="ToolBarThumbStyle" TargetType="{x:Type Thumb}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Thumb}">
          <Border Background="Transparent" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
            <Rectangle>
              <Rectangle.Fill>
                <DrawingBrush TileMode="Tile" Viewbox="0,0,4,4" Viewport="0,0,4,4" ViewportUnits="Absolute" ViewboxUnits="Absolute">
                  <DrawingBrush.Drawing>
                    <DrawingGroup>
                      <GeometryDrawing Brush="White" Geometry="M 1 1 L 1 3 L 3 3 L 3 1 z"/>
                      <GeometryDrawing Brush="{StaticResource ToolBarGripper}" Geometry="M 0 0 L 0 2 L 2 2 L 2 0 z"/>
                    </DrawingGroup>
                  </DrawingBrush.Drawing>
                </DrawingBrush>
              </Rectangle.Fill>
            </Rectangle>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Cursor" Value="SizeAll"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ToolBarMainPanelBorderStyle" TargetType="{x:Type Border}">
    <Setter Property="Margin" Value="0,0,11,0"/>
    <Setter Property="CornerRadius" Value="3,3,3,3"/>
    <Style.Triggers>
      <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
        <Setter Property="CornerRadius" Value="0,0,0,0"/>
      </DataTrigger>
    </Style.Triggers>
  </Style>
  <Style TargetType="{x:Type ToolBar}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToolBar}">
          <Grid x:Name="Grid" Margin="3,1,1,1" SnapsToDevicePixels="true">
            <Grid x:Name="OverflowGrid" HorizontalAlignment="Right">
              <ToggleButton x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}" IsChecked="{Binding IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" IsEnabled="{TemplateBinding HasOverflowItems}" Style="{StaticResource ToolBarHorizontalOverflowButtonStyle}">
                <ToggleButton.Background>
                  <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFE6E6E6" Offset="0"/>
                    <GradientStop Color="#FFD6D6D6" Offset="0.5"/>
                    <GradientStop Color="#FFE6E6E6" Offset="1"/>
                  </LinearGradientBrush>
                </ToggleButton.Background>
              </ToggleButton>
              <Popup x:Name="OverflowPopup" AllowsTransparency="true" Focusable="false" IsOpen="{Binding IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom" StaysOpen="false">
                <themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
                  <Border x:Name="ToolBarSubMenuBorder" BorderBrush="{StaticResource ToolBarMenuBorder}" BorderThickness="1" Background="{StaticResource ToolBarSubMenuBackground}" RenderOptions.ClearTypeHint="Enabled">
                    <ToolBarOverflowPanel x:Name="PART_ToolBarOverflowPanel" KeyboardNavigation.DirectionalNavigation="Cycle" FocusVisualStyle="{x:Null}" Focusable="true" Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" WrapWidth="200"/>
                  </Border>
                </themes:SystemDropShadowChrome>
              </Popup>
            </Grid>
            <Border x:Name="MainPanelBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Style="{StaticResource ToolBarMainPanelBorderStyle}">
              <DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local">
                <Thumb x:Name="ToolBarThumb" Margin="-3,-1,0,0" Padding="6,5,1,6" Style="{StaticResource ToolBarThumbStyle}" Width="10"/>
                <ContentPresenter x:Name="ToolBarHeader" ContentSource="Header" HorizontalAlignment="Center" Margin="4,0,4,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
                <ToolBarPanel x:Name="PART_ToolBarPanel" IsItemsHost="true" Margin="0,1,2,2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
              </DockPanel>
            </Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsOverflowOpen" Value="true">
              <Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false"/>
            </Trigger>
            <Trigger Property="Header" Value="{x:Null}">
              <Setter Property="Visibility" TargetName="ToolBarHeader" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="ToolBarTray.IsLocked" Value="true">
              <Setter Property="Visibility" TargetName="ToolBarThumb" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="HasDropShadow" SourceName="OverflowPopup" Value="true">
              <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
              <Setter Property="SnapsToDevicePixels" TargetName="Shdw" Value="true"/>
              <Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
              <Setter Property="Margin" TargetName="Grid" Value="1,3,1,1"/>
              <Setter Property="Style" TargetName="OverflowButton" Value="{StaticResource ToolBarVerticalOverflowButtonStyle}"/>
              <Setter Property="Height" TargetName="ToolBarThumb" Value="10"/>
              <Setter Property="Width" TargetName="ToolBarThumb" Value="Auto"/>
              <Setter Property="Margin" TargetName="ToolBarThumb" Value="-1,-3,0,0"/>
              <Setter Property="Padding" TargetName="ToolBarThumb" Value="5,6,6,1"/>
              <Setter Property="Margin" TargetName="ToolBarHeader" Value="0,0,0,4"/>
              <Setter Property="Margin" TargetName="PART_ToolBarPanel" Value="1,0,2,2"/>
              <Setter Property="DockPanel.Dock" TargetName="ToolBarThumb" Value="Top"/>
              <Setter Property="DockPanel.Dock" TargetName="ToolBarHeader" Value="Top"/>
              <Setter Property="HorizontalAlignment" TargetName="OverflowGrid" Value="Stretch"/>
              <Setter Property="VerticalAlignment" TargetName="OverflowGrid" Value="Bottom"/>
              <Setter Property="Placement" TargetName="OverflowPopup" Value="Right"/>
              <Setter Property="Margin" TargetName="MainPanelBorder" Value="0,0,0,11"/>
              <Setter Property="Background" Value="{StaticResource ToolBarVerticalBackground}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
      <DataTrigger Binding="{Binding Source={x:Static SystemParameters.HighContrast}}" Value="true">
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
      </DataTrigger>
    </Style.Triggers>
  </Style>

  <!-- Toolbar Button Styles -->
  <Style x:Key="ButtonFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Rectangle SnapsToDevicePixels="true" Margin="3" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="LabelStyle" TargetType="{x:Type Label}" BasedOn="{x:Null}">
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Label}">
          <Grid>
            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RecognizesAccessKey="True"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- Drop Down Button -->
  <DataTemplate x:Key="DropDownMenuIconStyle">
    <Image Source="{Binding XPath=.}"></Image>
  </DataTemplate>
  <ControlTemplate x:Key="DropDownMenuItemTemplate" TargetType="MenuItem">
    <Border Name="Border">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
          <ColumnDefinition Width="13"/>
        </Grid.ColumnDefinitions>
        <ContentPresenter x:Name="Icon"
                          ContentTemplate="{StaticResource DropDownMenuIconStyle}"
                          Margin="6,0,6,0"
                          VerticalAlignment="Center"
                          ContentSource="Icon"
                          Height="16" Width="16"/>
        <Border x:Name="Check"
                Width="13" Height="13"
                Visibility="Collapsed"
                Margin="6,0,6,0"
                Background="{StaticResource NormalBrush}"
                BorderThickness="1"
                BorderBrush="{StaticResource NormalBorderBrush}">
          <Path x:Name="CheckMark"
                Width="7" Height="7"
                Visibility="Hidden"
                SnapsToDevicePixels="False"
                Stroke="{StaticResource GlyphBrush}"
                StrokeThickness="2"
                Data="M 0 0 L 7 7 M 0 7 L 7 0" />
        </Border>
        <ContentPresenter x:Name="HeaderHost"
                          Grid.Column="1"
                          ContentSource="Header"
                          RecognizesAccessKey="True"
                          Margin="5,2,0,2"
                          VerticalAlignment="Center"/>
        <TextBlock x:Name="InputGestureText"
                   Grid.Column="2"
                   Text="{TemplateBinding InputGestureText}"
                   Margin="5,2,0,2"
                   DockPanel.Dock="Right" />
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
      </Trigger>
      <Trigger Property="IsChecked" Value="true">
        <Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
      </Trigger>
      <Trigger Property="IsCheckable" Value="true">
        <Setter TargetName="Check" Property="Visibility" Value="Visible"/>
        <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
      </Trigger>
      <Trigger Property="IsHighlighted" Value="true">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="false">
        <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>
  <Style x:Key="ToolBarDropDownButtonStyle" TargetType="{x:Type control:DropDownButton}">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="BorderThickness" Value="1,1,1,1"/>
    <Setter Property="Background" Value="#00FFFFFF"/>
    <Setter Property="BorderBrush" Value="#00FFFFFF"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="Margin" Value="2,2,2,2" />
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type control:DropDownButton}">
          <Border SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <!--<Label>-->
            <StackPanel Orientation="Vertical">
              <Image Margin="2,2,2,2" VerticalAlignment="Center" Width="16" Height="16" Source="{TemplateBinding Image}"/>
              <Label Content="{TemplateBinding Text}" Target="{TemplateBinding Target}" VerticalAlignment="Center" Padding="0" />
              <Path Fill="{DynamicResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z"  Height="5" Margin="5,2,2,0"/>
            </StackPanel>
            <!--</Label>-->
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="True">
              <Setter Property="BorderBrush" Value="#FF316AC5"/>
              <Setter Property="Background" Value="#FFE1E6E8"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="BorderBrush" Value="#FF316AC5"/>
              <Setter Property="Background" Value="#FFC1D2EE"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
              <Setter Property="BorderBrush" Value="#FF316AC5"/>
              <Setter Property="Background" Value="#FFC1D2EE"/>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True"/>
                <Condition Property="IsChecked" Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" Value="#FF4B4B6F"/>
              <Setter Property="Background" Value="#FF98B5E2"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsKeyboardFocused" Value="True"/>
                <Condition Property="IsChecked" Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" Value="#FF4B4B6F"/>
              <Setter Property="Background" Value="#FF98B5E2"/>
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="BorderBrush" Value="#FF4B4B6F"/>
              <Setter Property="Background" Value="#FF98B5E2"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- Split Button -->
  <Style x:Key="MainButtonStyle" TargetType="{x:Type Button}" BasedOn="{x:Null}">
    <Setter Property="Margin" Value="-2,-2,0,-2" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Grid>
            <Rectangle x:Name="rect" Fill="Transparent" Stroke="#00000000" />
            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsFocused" Value="True"/>
            <Trigger Property="IsDefaulted" Value="True"/>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Fill" TargetName="rect" Value="#00FFFFFF"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Fill" TargetName="rect" Value="#E3E3DC"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False"/>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="Background" Value="#00FFFFFF"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border x:Name="Bd" SnapsToDevicePixels="True" Background="{TemplateBinding Background}">
            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Background" TargetName="Bd" Value="#FF98B5E2"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ToolBarSplitButtonStyle" TargetType="{x:Type control:SplitButton}" >
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="BorderThickness" Value="1,1,1,1"/>
    <Setter Property="Background" Value="#00FFFFFF"/>
    <Setter Property="BorderBrush" Value="#00FFFFFF"/>
    <Setter Property="HorizontalAlignment" Value="Stretch"/>
    <Setter Property="VerticalAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type control:SplitButton}">
          <Border SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
            <StackPanel Orientation="Horizontal">
              <Button x:Name="PART_Button" Style="{DynamicResource ButtonStyle}">
                <StackPanel Orientation="Vertical">
                  <Image Margin="2,2,2,2" VerticalAlignment="Center" Width="16" Height="16" Source="{TemplateBinding Image}"/>
                  <Label Content="{TemplateBinding Text}" Target="{TemplateBinding Target}" VerticalAlignment="Center" Padding="0" Margin="0,0,3,0"/>
                </StackPanel>
              </Button>
              <Border x:Name="line" Visibility="Hidden" BorderThickness="1,0,0,0" BorderBrush="{TemplateBinding BorderBrush}" />
              <Path Fill="{DynamicResource GlyphBrush}" Data="M 0 0 L 4 4 L 8 0 Z"  Height="5" Margin="2,2,2,0"/>
            </StackPanel>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="True">
              <Setter Property="BorderBrush" Value="#FF316AC5"/>
              <Setter Property="Background" Value="#FFE1E6E8"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="BorderBrush" Value="#FF316AC5"/>
              <Setter Property="Background" Value="#FFC1D2EE"/>
              <Setter Property="Visibility" Value="Visible" TargetName="line"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
              <Setter Property="BorderBrush" Value="#FF316AC5"/>
              <Setter Property="Background" Value="#FFC1D2EE"/>
              <Setter Property="Visibility" Value="Visible" TargetName="line"/>
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsMouseOver" Value="True"/>
                <Condition Property="IsChecked" Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" Value="#FF4B4B6F"/>
              <Setter Property="Background" Value="#FF98B5E2"/>
              <Setter Property="Visibility" Value="Visible" TargetName="line"/>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="IsKeyboardFocused" Value="True"/>
                <Condition Property="IsChecked" Value="True"/>
              </MultiTrigger.Conditions>
              <Setter Property="BorderBrush" Value="#FF4B4B6F"/>
              <Setter Property="Background" Value="#FF98B5E2"/>
              <Setter Property="Visibility" Value="Visible" TargetName="line"/>
            </MultiTrigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="BorderBrush" Value="#FF4B4B6F"/>
              <Setter Property="Background" Value="#FF98B5E2"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <DataTemplate x:Key="SplitMenuIconStyle">
    <Image Source="{Binding XPath=.}"></Image>
  </DataTemplate>
  <ControlTemplate x:Key="SplitMenuItemTemplate" TargetType="MenuItem">
    <Border Name="Border">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" SharedSizeGroup="Icon"/>
          <ColumnDefinition Width="*" />
          <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
          <ColumnDefinition Width="13"/>
        </Grid.ColumnDefinitions>
        <ContentPresenter x:Name="Icon"
                          ContentTemplate="{StaticResource SplitMenuIconStyle}"
                          Margin="6,0,6,0"
                          VerticalAlignment="Center"
                          ContentSource="Icon"
                          Height="16" Width="16"/>
        <Border x:Name="Check"
                Width="13" Height="13"
                Visibility="Collapsed"
                Margin="6,0,6,0"
                Background="{StaticResource NormalBrush}"
                BorderThickness="1"
                BorderBrush="{StaticResource NormalBorderBrush}">
          <Path x:Name="CheckMark"
                Width="7" Height="7"
                Visibility="Hidden"
                SnapsToDevicePixels="False"
                Stroke="{StaticResource GlyphBrush}"
                StrokeThickness="2"
                Data="M 0 0 L 7 7 M 0 7 L 7 0" />
        </Border>
        <ContentPresenter x:Name="HeaderHost"
                          Grid.Column="1"
                          ContentSource="Header"
                          RecognizesAccessKey="True"
                          Margin="5,2,0,2"
                          VerticalAlignment="Center"/>
        <TextBlock x:Name="InputGestureText"
                   Grid.Column="2"
                   Text="{TemplateBinding InputGestureText}"
                   Margin="5,2,0,2"
                   DockPanel.Dock="Right" />
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="Icon" Value="{x:Null}">
        <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
      </Trigger>
      <Trigger Property="IsChecked" Value="true">
        <Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
      </Trigger>
      <Trigger Property="IsCheckable" Value="true">
        <Setter TargetName="Check" Property="Visibility" Value="Visible"/>
        <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
      </Trigger>
      <Trigger Property="IsHighlighted" Value="true">
        <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="false">
        <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
      </Trigger>
    </ControlTemplate.Triggers>
  </ControlTemplate>

  <!-- Expander -->
  <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ToggleButton}">
          <Border Padding="{TemplateBinding Padding}">
            <Grid SnapsToDevicePixels="False" Background="Transparent">
              <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 Fill="{DynamicResource ExpanderArrowFill}"  HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
                <Path Stroke="white" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
              </Grid>
              <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True"/>
            </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="#FF3C7FB1"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowHoverFill}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="white"/>
            </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="{DynamicResource ExpanderArrowPressedFill}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="white"/>
            </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 SnapsToDevicePixels="False" Background="Transparent">
              <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 Fill="{DynamicResource ExpanderArrowFill}"  HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
                <Path Stroke="white" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
              </Grid>
              <ContentPresenter HorizontalAlignment="Stretch" Margin="4,0,19,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True"/>
            </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="#FF3C7FB1"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowHoverFill}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="white"/>
            </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="{DynamicResource ExpanderArrowPressedFill}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="white"/>
            </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 SnapsToDevicePixels="False" Background="Transparent">
              <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 Fill="{DynamicResource ExpanderArrowFill}"  HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
                <Path Stroke="white" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
              </Grid>
              <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True"/>
            </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="#FF3C7FB1"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowHoverFill}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="white"/>
            </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="{DynamicResource ExpanderArrowPressedFill}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="white"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ExpanderHeaderFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Border>
            <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="0" SnapsToDevicePixels="true"/>
          </Border>
        </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 SnapsToDevicePixels="False" Background="Transparent">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="19"/>
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Ellipse Fill="{DynamicResource ExpanderArrowFill}"  HorizontalAlignment="Center" x:Name="circle" VerticalAlignment="Center" Width="19" Height="19"/>
              <Path Stroke="white" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
              <ContentPresenter HorizontalAlignment="Stretch" Margin="4,0,19,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True"/>
            </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="#FF3C7FB1"/>
              <Setter Property="Fill" TargetName="circle" Value="{DynamicResource ExpanderArrowHoverFill}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="white"/>
            </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="{DynamicResource ExpanderArrowPressedFill}"/>
              <Setter Property="Stroke" TargetName="arrow" Value="white"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="StretchExpanderStyle" 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="0"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Expander}">
          <Border SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
            <DockPanel>
              <ToggleButton FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" Margin="1" MinHeight="0" MinWidth="0" x:Name="HeaderSite" Style="{StaticResource ExpanderDownHeaderStyle}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" DockPanel.Dock="Top" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
              <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Focusable="false" Visibility="Collapsed" DockPanel.Dock="Bottom"/>
            </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 ExpanderLeftHeaderStyle}"/>
            </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 ExpanderRightHeaderStyle}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- CCA -->
  <Style TargetType="{x:Type mucc:AifWpfTabControl}">
    <Setter Property="Background" Value="Transparent"></Setter>
  </Style>
  <!--Style TargetType="{x:Type mucc:AifWpfDeckControl}">
          <Setter Property="BorderThickness"  Value="4"></Setter>
          <Setter Property="BorderBrush"  Value="Black"></Setter>
      </Style-->

  <!-- USD -->
  <Style TargetType="{x:Type Button}">
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="Padding" Value="2"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type Button}">
          <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonHoverBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonHoverBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonHover}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ToolBarButtonPressedBorder}"/>
              <Setter Property="Background" TargetName="Bd" Value="{StaticResource ToolBarButtonPressed}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- RibbonControl -->
  <Style x:Key="RibbonControlStyle">
      <Setter Property="ribbon:RibbonControlService.Label" Value="{Binding Label}" />
      <Setter Property="ribbon:RibbonControlService.LargeImageSource" Value="{Binding LargeImage}" />
      <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{Binding SmallImage}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipTitle" Value="{Binding ToolTipTitle}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipDescription" Value="{Binding ToolTipDescription}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{Binding ToolTipImage}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipFooterTitle" Value="{Binding ToolTipFooterTitle}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipFooterDescription" Value="{Binding ToolTipFooterDescription}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipFooterImageSource" Value="{Binding ToolTipFooterImage}" />
      <Style.Triggers>
          <DataTrigger Binding="{Binding LargeImage}" Value="{x:Null}">
              <Setter Property="ribbon:RibbonControlService.LargeImageSource" Value="{x:Null}" />
          </DataTrigger>
          <DataTrigger Binding="{Binding SmallImage}" Value="{x:Null}">
              <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{x:Null}" />
          </DataTrigger>
          <DataTrigger Binding="{Binding ToolTipImage}" Value="{x:Null}">
              <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{x:Null}" />
          </DataTrigger>
          <DataTrigger Binding="{Binding ToolTipFooterImage}" Value="{x:Null}">
              <Setter Property="ribbon:RibbonControlService.ToolTipFooterImageSource" Value="{x:Null}" />
          </DataTrigger>
          <Trigger Property="ribbon:RibbonControlService.IsInQuickAccessToolBar" Value="False">
              <Setter Property="KeyTipService.KeyTip" Value="{Binding KeyTip}" />
          </Trigger>
      </Style.Triggers>
  </Style>

  <!-- RibbonGroup -->
  <Style TargetType="{x:Type ribbon:RibbonGroup}"  BasedOn="{StaticResource RibbonControlStyle}">
      <Setter Property="QuickAccessToolBarId" Value="{Binding Label}" />
      <Setter Property="Header" Value="{Binding Label}" />
  </Style>

  <!-- RibbonButton -->
  <Style TargetType="{x:Type ribbon:RibbonButton}" BasedOn="{StaticResource RibbonControlStyle}">
      <Setter Property="Command" Value="{Binding Command}" />
  </Style>

  <!-- RibbonToggleButton -->
  <Style TargetType="{x:Type ribbon:RibbonToggleButton}" BasedOn="{StaticResource RibbonControlStyle}">
      <Setter Property="Command" Value="{Binding Command}" />
      <Setter Property="IsChecked" Value="{Binding IsChecked}" />
  </Style>

  <!-- RibbonRadioButton -->
  <Style TargetType="{x:Type ribbon:RibbonRadioButton}" BasedOn="{StaticResource RibbonControlStyle}">
      <Setter Property="Command" Value="{Binding Command}" />
      <Setter Property="IsChecked" Value="{Binding IsChecked}" />
  </Style>

  <!-- RibbonCheckBox -->
  <Style TargetType="{x:Type ribbon:RibbonCheckBox}" BasedOn="{StaticResource RibbonControlStyle}">
      <Setter Property="Command" Value="{Binding Command}" />
      <Setter Property="IsChecked" Value="{Binding IsChecked}" />
  </Style>

  <!-- RibbonTextBox -->
  <Style TargetType="{x:Type ribbon:RibbonTextBox}" BasedOn="{StaticResource RibbonControlStyle}">
      <Setter Property="Command" Value="{Binding Command}" />
      <Setter Property="Text" Value="{Binding Text}" />
  </Style>

  <!-- RibbonMenuButton -->
  <Style TargetType="{x:Type ribbon:RibbonMenuButton}" BasedOn="{StaticResource RibbonControlStyle}">
      <Setter Property="QuickAccessToolBarId" Value="{Binding Command}" />
      <Setter Property="CanUserResizeVertically" Value="{Binding IsVerticallyResizable}" />
      <Setter Property="CanUserResizeHorizontally" Value="{Binding IsHorizontallyResizable}" />
  </Style>

  <!-- RibbonSplitButton -->
  <Style TargetType="{x:Type ribbon:RibbonSplitButton}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuButton}}">
      <Setter Property="IsCheckable" Value="{Binding IsCheckable}" />
      <Setter Property="IsChecked" Value="{Binding IsChecked}" />
      <Setter Property="Command" Value="{Binding Command}" />
      <Setter Property="HeaderQuickAccessToolBarId" Value="{Binding Label}" />
      <Setter Property="DropDownToolTipTitle" Value="{Binding DropDownButtonData.ToolTipTitle}" />
      <Setter Property="DropDownToolTipDescription" Value="{Binding DropDownButtonData.ToolTipDescription}" />
      <Setter Property="DropDownToolTipImageSource" Value="{Binding DropDownButtonData.ToolTipImage}" />
      <Setter Property="DropDownToolTipFooterTitle" Value="{Binding DropDownButtonData.ToolTipFooterTitle}" />
      <Setter Property="DropDownToolTipFooterDescription" Value="{Binding DropDownButtonData.ToolTipFooterDescription}" />
      <Setter Property="DropDownToolTipFooterImageSource" Value="{Binding DropDownButtonData.ToolTipFooterImage}" />
  </Style>

  <!-- RibbonComboBox -->
  <Style TargetType="{x:Type ribbon:RibbonComboBox}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuButton}}">
      <Setter Property="IsEditable" Value="True" />
      <Setter Property="CanUserResizeVertically" Value="True" />
  </Style>

  <!-- RibbonGallery FilterItemContainerStyle -->
  <Style TargetType="{x:Type ribbon:RibbonMenuItem}" x:Key="FilterMenuItemStyle">
      <Setter Property="Header" Value="{Binding Label}"/>
  </Style>

  <!-- RibbonGallery -->
  <Style TargetType="{x:Type ribbon:RibbonGallery}">
      <Style.Resources>
          <!-- Note that this Style has been specified only to trump the 
                        implicit style for RibbonMenuItem from being picked by the 
                        items within the FilterMenuButton -->
          <Style TargetType="{x:Type ribbon:RibbonMenuItem}" />
      </Style.Resources>
      <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{Binding SmallImage}" />
      <Setter Property="ItemsSource" Value="{Binding CategoryDataCollection}" />
      <Setter Property="Command" Value="{Binding Command}" />
      <Setter Property="SelectedItem" Value="{Binding SelectedItem}" />
      <Setter Property="CanUserFilter" Value="{Binding CanUserFilter}" />
      <Setter Property="FilterItemContainerStyle" Value="{StaticResource FilterMenuItemStyle}" />
      <Style.Triggers>
          <DataTrigger Binding="{Binding SmallImage}" Value="{x:Null}">
              <Setter Property="ribbon:RibbonControlService.SmallImageSource" Value="{x:Null}" />
          </DataTrigger>
      </Style.Triggers>
  </Style>

  <!-- RibbonGalleryCategory -->
  <Style TargetType="{x:Type ribbon:RibbonGalleryCategory}">
      <Setter Property="Header" Value="{Binding Label}" />
      <Setter Property="ItemsSource" Value="{Binding GalleryItemDataCollection}" />
  </Style>

  <!-- RibbonMenuItem -->
  <Style TargetType="{x:Type ribbon:RibbonMenuItem}">
      <Setter Property="Header" Value="{Binding Label}" />
      <Setter Property="ImageSource" Value="{Binding SmallImage}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipTitle" Value="{Binding ToolTipTitle}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipDescription" Value="{Binding ToolTipDescription}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{Binding ToolTipImage}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipFooterTitle" Value="{Binding ToolTipFooterTitle}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipFooterDescription" Value="{Binding ToolTipFooterDescription}" />
      <Setter Property="ribbon:RibbonControlService.ToolTipFooterImageSource" Value="{Binding ToolTipFooterImage}" />
      <Setter Property="KeyTipService.KeyTip" Value="{Binding KeyTip}" />
      <Setter Property="Command" Value="{Binding Command}" />
      <Setter Property="IsCheckable" Value="{Binding IsCheckable}" />
      <Setter Property="IsChecked" Value="{Binding IsChecked}" />
      <Setter Property="CanUserResizeVertically" Value="{Binding IsVerticallyResizable}" />
      <Setter Property="CanUserResizeHorizontally" Value="{Binding IsHorizontallyResizable}" />
      <Style.Triggers>
          <DataTrigger Binding="{Binding SmallImage}" Value="{x:Null}">
              <Setter Property="ImageSource" Value="{x:Null}" />
          </DataTrigger>
          <DataTrigger Binding="{Binding ToolTipImage}" Value="{x:Null}">
              <Setter Property="ribbon:RibbonControlService.ToolTipImageSource" Value="{x:Null}" />
          </DataTrigger>
          <DataTrigger Binding="{Binding ToolTipFooterImage}" Value="{x:Null}">
              <Setter Property="ribbon:RibbonControlService.ToolTipFooterImageSource" Value="{x:Null}" />
          </DataTrigger>
      </Style.Triggers>
  </Style>

  <!-- RibbonSplitMenuItem -->
  <Style TargetType="{x:Type ribbon:RibbonSplitMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuItem}}">
      <Setter Property="HeaderQuickAccessToolBarId" Value="{Binding Command}" />
      <Setter Property="QuickAccessToolBarId" Value="{Binding DropDownButtonData.Command}" />
      <Setter Property="HeaderKeyTip" Value="{Binding KeyTip}" />
      <Setter Property="KeyTip" Value="{Binding DropDownButtonData.KeyTip}" />
      <Setter Property="DropDownToolTipTitle" Value="{Binding DropDownButtonData.ToolTipTitle}" />
      <Setter Property="DropDownToolTipDescription" Value="{Binding DropDownButtonData.ToolTipDescription}" />
      <Setter Property="DropDownToolTipImageSource" Value="{Binding DropDownButtonData.ToolTipImage}" />
      <Setter Property="DropDownToolTipFooterTitle" Value="{Binding DropDownButtonData.ToolTipFooterTitle}" />
      <Setter Property="DropDownToolTipFooterDescription" Value="{Binding DropDownButtonData.ToolTipFooterDescription}" />
      <Setter Property="DropDownToolTipFooterImageSource" Value="{Binding DropDownButtonData.ToolTipFooterImage}" />
      <Style.Triggers>
          <DataTrigger Binding="{Binding DropDownButtonData.ToolTipImage}" Value="{x:Null}">
              <Setter Property="DropDownToolTipImageSource" Value="{x:Null}" />
          </DataTrigger>
          <DataTrigger Binding="{Binding DropDownButtonData.ToolTipFooterImage}" Value="{x:Null}">
              <Setter Property="DropDownToolTipFooterImageSource" Value="{x:Null}" />
          </DataTrigger>
      </Style.Triggers>
  </Style>

  <!-- RibbonApplicationMenuItem -->
  <Style TargetType="{x:Type ribbon:RibbonApplicationMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonMenuItem}}">
      <Style.Triggers>
          <Trigger Property="Level" Value="Middle">
              <Setter Property="ImageSource" Value="{Binding SmallImage}" />
              <Setter Property="KeyTipService.KeyTip" Value="{Binding KeyTip}" />
              <Setter Property="Command" Value="{Binding Command}" />
              <Setter Property="Header" Value="{Binding}" />
              <Setter Property="HeaderTemplate">
                  <Setter.Value>
                      <DataTemplate>
                          <Grid>
                              <Grid.RowDefinitions>
                                  <RowDefinition Height="Auto" />
                                  <RowDefinition Height="Auto" />
                              </Grid.RowDefinitions>
                              <AccessText Grid.Row="0" FontWeight="Bold" Text="{Binding Label}" />
                              <TextBlock Grid.Row="1" Text="{Binding ToolTipTitle}" TextWrapping="Wrap" />
                          </Grid>
                      </DataTemplate>
                  </Setter.Value>
              </Setter>
          </Trigger>
      </Style.Triggers>
  </Style>

  <!-- RibbonApplicationSplitMenuItem -->
  <Style TargetType="{x:Type ribbon:RibbonApplicationSplitMenuItem}" BasedOn="{StaticResource {x:Type ribbon:RibbonSplitMenuItem}}" />

  <!-- RibbonContextMenu -->
  <Style TargetType="{x:Type ribbon:RibbonContextMenu}">
      <Style.Resources>
          <!-- Note that this Style has been specified only to trump the 
                        implicit style for RibbonMenuItem from being picked by the 
                        items within the ContextMenu -->
          <Style TargetType="{x:Type ribbon:RibbonMenuItem}" />
      </Style.Resources>
  </Style>

  <!-- RibbonControlGroup -->
  <Style TargetType="{x:Type ribbon:RibbonControlGroup}">
      <Setter Property="Margin" Value="2,0,2,0" />
  </Style>

  <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
  <!-- RibbonContextualTabGroup -->
  <Style TargetType="{x:Type ribbon:RibbonContextualTabGroup}">
      <Setter Property="Header" Value="{Binding Header}" />
      <Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource BoolToVisibilityConverter}}" />
  </Style>

  <!-- RibbonTab -->
  <Style TargetType="{x:Type ribbon:RibbonTab}" x:Key="ContextualTabStyle">
      <Setter Property="ContextualTabGroupHeader" Value="{Binding ContextualTabGroupHeader}" />
      <Setter Property="Header" Value="{Binding Header}" />
      <Setter Property="IsSelected" Value="{Binding IsSelected}" />
  </Style>
</ResourceDictionary>
