<!--=================================================================
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
==================================================================-->

<ResourceDictionary x:Uid="MainResourceDictionary" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:g="clr-namespace:System.Globalization;assembly=mscorlib"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    xmlns:local="clr-namespace:Microsoft.Management.UI.Internal"
    xmlns:default="clr-namespace:"
    xmlns:aerotheme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    xmlns:classictheme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic">

    <Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>

    <Geometry x:Key="NavPane_ListViewItem_RightArrow">M7.3391155,8.3084572 L7.3391708,16.109179 10.974259,12.431834 z</Geometry>

    <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>

    <SolidColorBrush x:Key="AlmostInvisibleBackgroundBrush" Color="#01FFFFFF"/>

    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="{StaticResource {x:Static SystemColors.GrayTextColorKey}}"/>

    <SolidColorBrush x:Key="FilterBackgroundSearch" Color="#FFEDE7C5"/>

    <Geometry x:Key="SingleChevron">M0.83647823,8.3277649 L5.9975096,11.519699 11.198949,8.3030383</Geometry>

    <Geometry x:Key="LeftFacingOpenArrow">M205.63696,8.9046901 L201.73368,12.456607 205.68294,16.093484</Geometry>


    <!--=================================================================
            Designer Style Resources Xaml
        ==================================================================-->

    <Style x:Key="FocusVisual_Style">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <Rectangle
                            SnapsToDevicePixels="true"
                            StrokeThickness="0.75"
                            Stroke="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
                            />
                        <Rectangle
                            SnapsToDevicePixels="true"
                            StrokeThickness="0.75"
                            Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
                            StrokeDashArray="3 2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TransparentButton_Style" TargetType="{x:Type ButtonBase}" BasedOn="{x:Null}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual_Style}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ButtonBase}">
                    <ContentPresenter
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Padding" Value="0" />
        <Setter Property="ClickMode" Value="Press" />
    </Style>

    <Style x:Key="TextTrimmedTextBlockStyle" TargetType="TextBlock">
        <Setter Property="TextTrimming" Value="CharacterEllipsis" />
        <Setter Property="TextWrapping" Value="NoWrap" />
        <Setter Property="local:TextBlockService.IsTextTrimmedMonitoringEnabled" Value="True"/>
        <Setter Property="ToolTipService.Placement" Value="Relative" />
        <Setter Property="ToolTipService.HorizontalOffset" Value="-4" />
        <Style.Triggers>
            <Trigger Property="local:TextBlockService.IsTextTrimmed" Value="True">
                <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Text}" />
            </Trigger>

            <Trigger
                Property="local:TextBlockService.IsTextTrimmedExternally"
                Value="True">
                <Setter
                    Property="ToolTip"
                    Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(local:TextBlockService.UntrimmedText)}" />
            </Trigger>

        </Style.Triggers>
    </Style>

    <ControlTemplate x:Key="EmptyButton"
                     TargetType="{x:Type ButtonBase}">
        <Border Background="{StaticResource AlmostInvisibleBackgroundBrush}"
                BorderThickness="1">
            <ContentPresenter Margin="{TemplateBinding Padding}" />
        </Border>
    </ControlTemplate>

    <!--This is for themeing to make sure all textblocks behave as expected -->
    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    </Style>

    <Style x:Key="HeaderFontVisualStyle">
        <Setter Property="TextBlock.FontWeight" Value="Normal"/>
        <Setter Property="TextBlock.FontStyle" Value="Normal"/>
        <Setter Property="TextBlock.FontStretch" Value="Normal"/>
        <Setter Property="TextBlock.FontSize" Value="16"/>
        <Setter Property="TextBlock.Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    </Style>

    <!-- Style for Expand Collapse Chevron: points down -->
    <Style x:Key="GeneralExpandCollapseArrowStyle" TargetType="{x:Type Path}">
        <Setter Property="Data" Value="{StaticResource SingleChevron}"/>
        <Setter Property="Width" Value="10"/>
        <Setter Property="Height" Value="6"/>
        <Setter Property="Stroke" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Stretch" Value="Fill"/>
        <Setter Property="StrokeThickness" Value="2"/>
        <Setter Property="StrokeStartLineCap" Value="Round"/>
        <Setter Property="StrokeEndLineCap" Value="Round"/>
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
        <Setter Property="Path.RenderTransform">
            <Setter.Value>
                <TransformGroup >
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Points Right  Use for Nav Pane, CE Etc. -->
    <Style x:Key="GeneralArrowStyle" TargetType="{x:Type Path}">
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="Stroke" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Stretch" Value="Fill"/>
        <Setter Property="Data" Value="{StaticResource NavPane_ListViewItem_RightArrow}"/>
    </Style>

    <!-- Points Down Use for menus and the like -->
    <Style x:Key="GeneralArrowStyleDown" TargetType="{x:Type Path}" BasedOn="{StaticResource GeneralArrowStyle}">
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="90"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RotatingArrowToggleButtonStyle"
           TargetType="{x:Type ToggleButton}">
        <Setter Property="ToolTip" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_DesignerStyleResources_ToolTip_97}" />
        <Setter Property="Background" Value="{StaticResource AlmostInvisibleBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource AlmostInvisibleBackgroundBrush}" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border x:Name="border" Padding="4,3,3,4" BorderThickness="1" CornerRadius="2"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            ToolTip="{TemplateBinding ToolTip}"
                            Cursor="{TemplateBinding Cursor}">
                        <StackPanel Orientation="Horizontal">
                            <Path x:Name="Arrow" Style="{StaticResource GeneralExpandCollapseArrowStyle}" Margin="0,0,5,0" Stroke="{TemplateBinding Foreground}" />
                            <ContentPresenter VerticalAlignment="Center"/>
                        </StackPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                            <Setter Property="ToolTip" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_DesignerStyleResources_ToolTip_119}" />
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Arrow"
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="Arrow"
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- Pop Up border a la Column Explorer -->
    <Style x:Key="General_PopUp_InnerBorder" TargetType="{x:Type Border}" >
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
        <Setter Property="Padding" Value="8,4,8,8"/>
    </Style>


    <Style x:Key="GeneralHighlightedArrowStyle" TargetType="{x:Type Path}" BasedOn="{StaticResource GeneralArrowStyle}">
        <Setter Property="Stroke" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
        <Setter Property="Fill" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
    </Style>

    <Style x:Key="General_PopUp_OuterBorder" TargetType="{x:Type Border}" >
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"/>
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
        <Setter Property="BorderThickness" Value="1,1,1,1"/>
        <Setter Property="CornerRadius" Value="0"/>
    </Style>

    <Style x:Key="General_PopUp_MiddleBorder" TargetType="{x:Type Border}" >
        <Setter Property="Margin" Value="1,1,1,1"/>
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="Padding" Value="4,4,4,4"/>
    </Style>

    <!--Style for NP TabItem-->
    <Style x:Key="MUX_TabControlStyle" TargetType="{x:Type TabControl}">
        <Setter Property="BorderThickness" Value="0,1,0,0"/>
        <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
    </Style>

    <!--Style for NP TabItem-->
    <Style x:Key="MUX_TabItemStyle" TargetType="{x:Type TabItem}">
    </Style>


    <Style x:Key="ExpanderButton_FaceStyle" TargetType="{x:Type Path}">
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
        <Style.Triggers>
            <!-- Use different colors if the button is disabled -->
            <Trigger Property="ButtonBase.IsEnabled" Value="False">
                <Setter Property="Fill" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ExpanderButton_Face_Style" TargetType="{x:Type Path}" BasedOn="{StaticResource ExpanderButton_FaceStyle}">
        <Setter Property="Data" Value="F1 M 15.0918,20.973L 20.8741,15.1906L 26.8723,21.1888L 25.2473,22.8138L 20.8198,18.4872L 16.7129,22.5941L 15.0918,20.973 Z " />
        <Setter Property="RenderTransformOrigin" Value="0.487,0.6" />
        <Setter Property="Height" Value="5.5" />
    </Style>


    <ControlTemplate x:Key="ExpanderButton_Template" TargetType="{x:Type ToggleButton}" x:Shared="False">
        <Grid >
            <Ellipse x:Name="BackgroundCircle"
                     Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
                     Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Path Style="{StaticResource ExpanderButton_Face_Style}" >
                <Path.RenderTransform>
                    <RotateTransform x:Name="AngleName" Angle="0"/>
                </Path.RenderTransform>
            </Path>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="False">
                <Setter Property="ToolTip" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_DesignerStyleResources_ToolTip_97}" />
                <Trigger.EnterActions>
                    <BeginStoryboard >
                        <Storyboard >
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                            Storyboard.TargetName="AngleName"
                                            Storyboard.TargetProperty="Angle">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard >
                        <Storyboard >
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                            Storyboard.TargetName="AngleName"
                                            Storyboard.TargetProperty="Angle">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.ExitActions>
            </Trigger>
            <!-- Use different colors if the button is disabled -->
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="BackgroundCircle" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="ButtonBase_Style" TargetType="{x:Type ButtonBase}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual_Style}"/>
        <Setter Property="Width" Value="16" />
        <Setter Property="Height" Value="16" />
        <Setter Property="Margin" Value="2,0,2,0" />
        <Setter Property="Cursor" Value="Hand" />
    </Style>

    <Style x:Key="ExpanderButton_Style" TargetType="{x:Type ToggleButton}"
           BasedOn="{StaticResource ButtonBase_Style}"  x:Shared="False">
        <Setter Property="ToolTip" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_DesignerStyleResources_ToolTip_119}" />
        <Setter Property="Template" Value="{StaticResource ExpanderButton_Template}" />
    </Style>

    <!-- End of Styles from Tile that are used in ManagementList-->


    <!--=================================================================
        Converts Xaml
    ==================================================================-->

    <!-- Converters -->
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <local:ValidatingSelectorValueToDisplayNameConverter x:Key="ValidatingSelectorValueToDisplayNameConverter" />

    <local:VisualToAncestorDataConverter x:Key="VisualToAncestorDataConverter"/>

    <local:TextTrimConverter x:Key="TextTrimConverter" />

    <local:IntegralConverter x:Key="IntegralConverter" />

    <local:ResizerGripThicknessConverter x:Key="ResizerGripThicknessConverter"/>

    <local:InverseBooleanConverter x:Key="InverseBooleanConverter"/>

    <local:DefaultStringConverter x:Key="NewQueryStringConverter"
                                  DefaultValue="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList_Text_602}"/>

    <local:StringFormatConverter x:Key="StringFormatConverter"/>

    <local:IsEqualConverter x:Key="IsEqualConverter"/>

    <local:IsNotNullConverter x:Key="IsNotNullConverter" />

    <local:IsValidatingValueValidConverter x:Key="IsValidatingValueValidConverter" />

    <local:InputFieldBackgroundTextConverter x:Key="InputFieldBackgroundTextConverter" />


    <!--=================================================================
        Icons Xaml
    ==================================================================-->
    <!--=================================================================
            Add Filter Rule Picker Default Templates
        ==================================================================-->

    <DataTemplate x:Key="AddFilterRulePicker_PickerBase_Header_Template">
        <StackPanel Orientation="Horizontal">

            <local:ScalableImage Margin="1,5,0,4">
                <local:ScalableImage.Source>
                    <local:ScalableImageSource Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/Add16.png"
                                               Size="9,9" />
                </local:ScalableImage.Source>
            </local:ScalableImage>

            <TextBlock x:Name="btnAddContentTextblock"
                       Text="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_Text_124}"
                       VerticalAlignment="Center"
                       Margin="5,0,2,0" />

            <Path x:Name="AddContent_ArrowDown"
                  Style="{StaticResource GeneralArrowStyleDown}"
                  Margin="5,0,5,0" />

        </StackPanel>
    </DataTemplate>

    <Style x:Key="AddFilterRuleItemCheckBox_Style" TargetType="{x:Type CheckBox}">
        <Setter Property="Margin" Value="2,2,2,0" />
    </Style>

    <DataTemplate x:Key="AddFilterRulePicker_PickerBase_Content_FilterItem_Template">
        <ToggleButton x:Name="AddFilterRuleItem"
                      AutomationProperties.Name="{Binding Path=Text, ElementName=AddFilterRuleItemName}"
                      IsChecked="{Binding Path=IsChecked}"
                      KeyboardNavigation.AcceptsReturn="False"
                      HorizontalContentAlignment="Stretch"
                      Margin="0"
                      Padding="0"
                      Template="{StaticResource EmptyButton}">

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <CheckBox x:Name="AddFilterRuleItemCheckBox"
                          AutomationProperties.Name="{Binding Path=Text, ElementName=AddFilterRuleItemName}"
                          IsChecked="{Binding Path=IsChecked}"
                          VerticalAlignment="Top"
                          Style="{StaticResource AddFilterRuleItemCheckBox_Style}"
                          IsTabStop="False">
                    <CheckBox.Content>
                        <Border x:Name="InnerBorder"
                                Grid.Column="1"
                                Padding="2,1,2,1">
                            <local:AutomationTextBlock x:Name="AddFilterRuleItemName"
                                TextWrapping="Wrap"
                                Text="{Binding Path=FilterRule.Rule.DisplayName}" />
                        </Border>
                    </CheckBox.Content>
                </CheckBox>
            </Grid>
        </ToggleButton>
        <DataTemplate.Triggers>
            <Trigger Property="IsKeyboardFocusWithin"
                     Value="True">
                <Setter TargetName="InnerBorder"
                        Property="Background"
                        Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                <Setter TargetName="AddFilterRuleItemName"
                        Property="Foreground"
                        Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
            </Trigger>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter TargetName="InnerBorder"
                        Property="Background"
                        Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                <Setter TargetName="AddFilterRuleItemName"
                        Property="Foreground"
                        Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
            </Trigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <DataTemplate x:Key="AddFilterRulePicker_PickerBase_Content_Template">
        <Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
                BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"
                BorderThickness="1"
                CornerRadius="2">

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <!-- Shortcut Rules -->
                <ScrollViewer x:Name="ShortcutRulesScrollViewer"
                              KeyboardNavigation.TabNavigation="Once"
                              HorizontalScrollBarVisibility="Disabled"
                              VerticalScrollBarVisibility="Auto">
                    <StackPanel>
                        <local:AutomationGroup x:Name="ShortcutRuleItems"
                                           AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_AddFilterRulePicker_AutomationPropertiesName_157}"
                                           IsTabStop="False">
                            <ItemsControl x:Name="PART_Rules"
                                  ItemsSource="{Binding Path=ShortcutFilterRules, RelativeSource={RelativeSource AncestorType={x:Type local:AddFilterRulePicker}}}"
                                  ItemTemplate="{StaticResource AddFilterRulePicker_PickerBase_Content_FilterItem_Template}"
                                  IsTabStop="False"
                                  Margin="1" />
                        </local:AutomationGroup>

                        <Separator
                            x:Name="PART_RulesSeparator"
                            Background="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
                            Margin="0,2,0,2"
                            Height="1" />

                        <local:AutomationGroup x:Name="ColumnRuleItems"
                                               AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_AddFilterRulePicker_AutomationPropertiesName_180}"
                                               IsTabStop="False">
                            <ItemsControl x:Name="PART_ExtraRules"
                                      ItemsSource="{Binding Path=ColumnFilterRules, RelativeSource={RelativeSource AncestorType={x:Type local:AddFilterRulePicker}}}"
                                      ItemTemplate="{StaticResource AddFilterRulePicker_PickerBase_Content_FilterItem_Template}"
                                      IsTabStop="False"
                                      Margin="1" />
                        </local:AutomationGroup>
                    </StackPanel>
                </ScrollViewer>

                <!--Footer Border-->

                <Grid Grid.Row="2"
                      Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Rectangle HorizontalAlignment="Stretch"
                               Height="3"
                               Grid.ColumnSpan="2">
                        <Rectangle.Fill>
                            <LinearGradientBrush StartPoint="0.5,1.0"
                                                 EndPoint="0.5,0.0">
                                <GradientStop Color="#88000000"
                                              Offset="0" />
                                <GradientStop Color="#00000000"
                                              Offset="1" />
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>

                    <local:AutomationButton x:Name="PART_OkButton"
                            Command="{x:Static local:AddFilterRulePicker.OkAddFilterRulesCommand}"
                            HorizontalAlignment="Right"
                            Grid.Row="1"
                            Content="{x:Static default:XamlLocalizableResources.AutoResXGen_AddFilterRulePicker_Content_214}"
                            MinWidth="70"
                            IsDefault="True"
                            Margin="5,5,10,3" />

                    <local:AutomationButton x:Name="PART_CancelButton"
                            Grid.Column="1"
                            Grid.Row="1"
                            Command="{x:Static local:AddFilterRulePicker.CancelAddFilterRulesCommand}"
                            Content="{x:Static default:XamlLocalizableResources.AutoResXGen_AddFilterRulePicker_Content_223}"
                            MinWidth="70"
                            IsCancel="True"
                            Margin="0,5,5,3" />
                </Grid>
            </Grid>
        </Border>

        <DataTemplate.Triggers>

            <!--Hide the separator if there are no shortcut filter rules -->
            <DataTrigger Binding="{Binding Path=ShortcutFilterRules.Count, RelativeSource={RelativeSource AncestorType={x:Type local:AddFilterRulePicker}}}"
                         Value="0">
                <Setter TargetName="PART_RulesSeparator"
                        Property="Visibility"
                        Value="Collapsed" />
            </DataTrigger>

            <!--Hide the separator if there are no column filter rules-->
            <DataTrigger Binding="{Binding Path=ColumnFilterRules.Count, RelativeSource={RelativeSource AncestorType={x:Type local:AddFilterRulePicker}}}"
                         Value="0">
                <Setter TargetName="PART_RulesSeparator"
                        Property="Visibility"
                        Value="Collapsed" />
            </DataTrigger>

        </DataTemplate.Triggers>
    </DataTemplate>

    <!--Add Filter Rule Picker Base Style-->
    <Style x:Key="AddFilterRulePicker_PickerBase_Style"
           TargetType="{x:Type local:PickerBase}">
        <Setter Property="HeaderTemplate"
                Value="{StaticResource AddFilterRulePicker_PickerBase_Header_Template}" />
        <Setter Property="ContentTemplate"
                Value="{StaticResource AddFilterRulePicker_PickerBase_Content_Template}" />
        <Setter Property="AutomationProperties.AutomationId"
                Value="AddFilterRulePicker" />
    </Style>

    <!--Add Filter Rule Picker-->
    <Style TargetType="{x:Type local:AddFilterRulePicker}">
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="BorderThickness"
                Value="0" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:AddFilterRulePicker}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">

                        <local:PickerBase x:Name="AddCriteriaPickerBase"
                                          AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_AddFilterRulePicker_AutomationPropertiesName_293}"
                                          IsOpen="{Binding Path=IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                          Style="{StaticResource AddFilterRulePicker_PickerBase_Style}">
                            <local:PickerBase.DropDownStyle>
                                <Style TargetType="{x:Type Popup}">
                                    <Setter Property="AutomationProperties.AutomationId" Value="AddSearchCriteriaDropDown" />
                                    <Setter Property="MinWidth" Value="200" />
                                    <Setter Property="MaxWidth" Value="400" />
                                    <Setter Property="MaxHeight" Value="300" />
                                </Style>
                            </local:PickerBase.DropDownStyle>
                        </local:PickerBase>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            Column Picker Xaml
        ==================================================================-->

    <!--ColumnPicker Styles-->
    <!-- These styles are available for theming the components of the ColumnPicker dialog. -->
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPWindowStyle}"
           TargetType="{x:Type Window}">
        <Setter Property="Width"
                Value="500" />
        <Setter Property="Height"
                Value="400" />
        <Setter Property="MinWidth"
                Value="400" />
        <Setter Property="MinHeight"
                Value="300" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPOuterGridStyle}"
           TargetType="{x:Type Grid}">
        <Setter Property="Margin"
                Value="5,5,5,5" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPNotSelectedListboxHeaderStyle}"
           TargetType="{x:Type Label}">
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPSelectedListboxHeaderStyle}"
           TargetType="{x:Type Label}">
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPWarningTextStyle}"
           TargetType="{x:Type TextBlock}">
        <Setter Property="HorizontalAlignment"
                Value="Center" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPNotSelectedListboxStyle}"
           TargetType="{x:Type ListBox}">
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPNotSelectedListboxItemStyle}"
           TargetType="{x:Type ListBoxItem}">
        <Setter Property="AutomationProperties.Name"
                Value="{Binding Path=DataDescription.DisplayName}" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPSelectedListboxStyle}"
           TargetType="{x:Type ListBox}">
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPSelectedListboxItemStyle}"
           TargetType="{x:Type ListBoxItem}">
        <Setter Property="AutomationProperties.Name"
                Value="{Binding Path=DataDescription.DisplayName}" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPAddRemoveStackPanelStyle}"
           TargetType="{x:Type StackPanel}">
        <Setter Property="Margin"
                Value="10,20,10,0" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPAddButtonStyle}"
           TargetType="{x:Type Button}">
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPRemoveButtonStyle}"
           TargetType="{x:Type Button}">
        <Setter Property="Margin"
                Value="0,10,0,0" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPUpDownStackPanelStyle}"
           TargetType="{x:Type StackPanel}">
        <Setter Property="Margin"
                Value="10,20,0,0" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPMoveUpButtonStyle}"
           TargetType="{x:Type Button}">
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPMoveDownButtonStyle}"
           TargetType="{x:Type Button}">
        <Setter Property="Margin"
                Value="0,10,0,0" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPOkCancelStackPanelStyle}"
           TargetType="{x:Type StackPanel}">
        <Setter Property="Margin"
                Value="0,10,0,0" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPOkButtonStyle}"
           TargetType="{x:Type Button}">
        <Setter Property="Margin"
                Value="0,0,10,0" />
        <Setter Property="MinWidth"
                Value="75" />
        <Setter Property="MinHeight"
                Value="23" />
        <Setter Property="Padding"
                Value="10,0,10,0" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPCancelButtonStyle}"
           TargetType="{x:Type Button}">
        <Setter Property="MinWidth"
                Value="75" />
        <Setter Property="MinHeight"
                Value="23" />
        <Setter Property="Padding"
                Value="10,0,10,0" />
    </Style>

    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPOkCancelButtonStyle}"
           TargetType="{x:Type Button}">
        <Setter Property="MinWidth"
                Value="75" />
        <Setter Property="Margin"
                Value="5,3,5,3" />
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPOkCancelFooterRectangleStyle}"
           TargetType="{x:Type Rectangle}">
        <Setter Property="Height"
                Value="3" />
        <Setter Property="Stroke"
                Value="{x:Null}" />
        <Setter Property="Fill">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0.5,1.0"
                                     EndPoint="0.5,0.0">
                    <GradientStop Color="#88000000"
                                  Offset="0" />
                    <GradientStop Color="#00000000"
                                  Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ColumnPicker}, ResourceId=CPOkCancelGridStyle}"
           TargetType="{x:Type Grid}">
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{x:Static SystemColors.ControlColor}" />
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            Filter Rule Panel Default Templates
        ==================================================================-->

    <Style x:Key="OperatorDropDown_Button_Style" TargetType="{x:Type ButtonBase}">
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />

        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ButtonBase}">
                    <TextBlock x:Name="PART_TextBlock"
                               TextDecorations="Underline"
                               Foreground="{TemplateBinding Foreground}">
                        <TextBlock.Text>
                            <MultiBinding Converter="{StaticResource ValidatingSelectorValueToDisplayNameConverter}">
                                <Binding />
                                <Binding Path="Tag" RelativeSource="{RelativeSource AncestorType={x:Type ComboBox}}" />
                            </MultiBinding>
                        </TextBlock.Text>
                    </TextBlock>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Cursor" Value="Hand" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="OperatorDropDown_Item_Template" TargetType="{x:Type ComboBoxItem}">
        <Border x:Name="innerBorder"
                Padding="2,1,2,1">
            <TextBlock x:Name="tb"
                       TextSearch.Text="{Binding Path=DisplayName, Mode=OneWay}">
                <TextBlock.Text>
                    <MultiBinding Converter="{StaticResource ValidatingSelectorValueToDisplayNameConverter}">
                        <Binding />
                        <Binding Path="Tag"
                                 RelativeSource="{RelativeSource AncestorType={x:Type ComboBox}}" />
                    </MultiBinding>
                </TextBlock.Text>
            </TextBlock>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter TargetName="innerBorder" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                <Setter TargetName="tb" Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
                <Setter TargetName="innerBorder" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                <Setter TargetName="tb" Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>


    <Style x:Key="OperatorDropDown_Style" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual_Style}" />
        <Setter Property="Margin" Value="0,5,0,0" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="AutomationProperties.AutomationId" Value="OperatorDropDownButton" />
        <Setter Property="AutomationProperties.Name" Value="{Binding Path=SelectedItem.DisplayName, RelativeSource={RelativeSource Self}}" />

        <Setter Property="ItemsControl.ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{x:Type ComboBoxItem}">
                    <Setter Property="Control.Template" Value="{StaticResource OperatorDropDown_Item_Template}" />
                    <Setter Property="AutomationProperties.AutomationId" Value="OperatorDropDownItem" />
                    <Setter Property="AutomationProperties.Name" Value="{Binding Path=DisplayName}" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBox}">
                    <Grid Name="MainGrid"
                          SnapsToDevicePixels="true">
                        <local:ExpanderButton
                            Focusable="False"
                            Style="{StaticResource OperatorDropDown_Button_Style}"
                            IsEnabled="{TemplateBinding IsEnabled}"
                            DataContext="{Binding Path=SelectedItem, RelativeSource={RelativeSource TemplatedParent}}"
                            IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>

                        <local:DismissiblePopup
                            SetFocusOnClose="True"
                            AllowsTransparency="True"
                            Placement="Bottom"
                            IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
                            PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
                            <classictheme:SystemDropShadowChrome Color="#71000000" Margin="0,0,5,5">
                                <Border x:Name="DropDownBorder"
                                        BorderThickness="1"
                                        BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
                                        Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
                                    <ScrollViewer CanContentScroll="true">
                                        <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained"
                                                        Margin="1"
                                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                    </ScrollViewer>
                                </Border>
                            </classictheme:SystemDropShadowChrome>
                        </local:DismissiblePopup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=ValidatingSelectorValueTemplate}">
        <ComboBox x:Name="cb"
                  SelectedIndex="{Binding Path=SelectedIndex}"
                  ItemsSource="{Binding Path=AvailableValues}"
                  Tag="{Binding Path=DisplayNameConverter}"
                  Style="{StaticResource OperatorDropDown_Style}">
        </ComboBox>
    </DataTemplate>

    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=RemoveFilterItemButtonStyle}"
           TargetType="Button">
        <Setter Property="VerticalAlignment"
                Value="Top" />

        <Setter Property="Margin"
                Value="5,3,0,0" />
        <Setter Property="Command"
                Value="{x:Static local:FilterRulePanel.RemoveRuleCommand}" />

        <Setter Property="CommandParameter"
                Value="{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource VisualToAncestorDataConverter}, ConverterParameter={x:Type local:FilterRulePanelItem}}" />

        <Setter Property="FocusVisualStyle"
                Value="{StaticResource FocusVisual_Style}" />
        <Setter Property="Background"
                Value="{StaticResource NormalBrush}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource NormalBorderBrush}" />

        <Setter Property="AutomationProperties.AutomationId"
                Value="RemoveFilterRulePanelItemButton" />
        <Setter Property="AutomationProperties.Name"
                Value="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList_AutomationPropertiesName_302}" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">

                    <Grid x:Name="Grid">
                        <Border BorderThickness="1,1,1,1"
                                CornerRadius="0,0,0,0"
                                Background="{StaticResource AlmostInvisibleBackgroundBrush}"
                                Width="18"
                                Height="18">
                            <local:ScalableImage x:Name="image">
                                <local:ScalableImage.Source>
                                    <local:ScalableImageSource Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/Delete16.png"
                                                               Size="10,10" />
                                </local:ScalableImage.Source>
                            </local:ScalableImage>
                        </Border>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="Foreground"
                                    Value="{StaticResource DisabledForegroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=CompositeRuleTemplate}">
        <WrapPanel>
            <local:AutomationTextBlock
                AutomationProperties.AutomationId="PropertyName"
                VerticalAlignment="Top"
                Margin="0,5,4,0"
                Text="{Binding Path=DisplayName, Mode=OneWay}" />

            <StackPanel Orientation="Horizontal">
                <!--Rules Selector-->
                <local:FilterRulePanelContentPresenter Content="{Binding Path=AvailableRules}" />

                <!--Rule Input-->
                <local:FilterRulePanelContentPresenter Content="{Binding Path=AvailableRules.SelectedValue}" />

                <!--Delete Button-->
                <local:AutomationButton Style="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=RemoveFilterItemButtonStyle}}" />
            </StackPanel>
        </WrapPanel>
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=CatchAllTemplate}">
        <!--The ContentTemplateSelector must be explicitly set to null, otherwise infinite loops are possible-->
        <ContentPresenter ContentTemplateSelector="{x:Null}" />
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=NoInputTemplate}">
        <ContentPresenter Content="{x:Null}" />
    </DataTemplate>

    <ControlTemplate x:Key="FilterRuleValidationErrorTemplate">
        <AdornedElementPlaceholder />
    </ControlTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=ComparableValueRuleTemplate}">
        <local:FilterRulePanelContentPresenter Content="{Binding Path=Value}" />
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=ValidatingValueTemplate}">
        <local:FilterRulePanelContentPresenter Content="{Binding}"
                                             ContentConverter="{x:Static local:ValidatingValueToGenericParameterTypeConverter.Instance}"/>
    </DataTemplate>

    <Style x:Key="ValidatingValueInput_Style" TargetType="{x:Type local:MessageTextBox}">
        <Setter Property="Text" Value="{Binding Path=Value, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource TextTrimConverter}}" />
        <Setter Property="AutomationProperties.Name" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_FilterRulePanel_AutomationPropertiesName_199}" />
        <Setter Property="AutomationProperties.AutomationId" Value="InputField" />
        <Setter Property="BackgroundText" Value="{Binding Converter={StaticResource InputFieldBackgroundTextConverter}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
        <Setter Property="Margin" Value="5, 2" />
        <Setter Property="Validation.ErrorTemplate" Value="{StaticResource FilterRuleValidationErrorTemplate}" />
        <Setter Property="Width" Value="100" />
    </Style>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=InputValueTemplate}">
        <StackPanel Orientation="Horizontal">
            <local:AutomationImage x:Name="ErrorGraphics"
                   Visibility="Collapsed"
                   Margin="5, 2, 0, 2"
                   Focusable="False"
                   AutomationProperties.Name="{Binding Path=(AutomationProperties.HelpText), ElementName=InputField}"
                   AutomationProperties.AutomationId="ErrorGraphics"
                   Stretch="None"
                   Width="16"
                   Height="16"
                   Source="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/Error16.png" />

            <local:MessageTextBox
                x:Name="InputField"
                AutomationProperties.HelpText="{Binding Path=(Validation.Errors).CurrentItem.ErrorContent, RelativeSource={RelativeSource Self}}"
                Style="{StaticResource ValidatingValueInput_Style}" />

            <local:DismissiblePopup
                Focusable="False"
                MinWidth="100"
                x:Name="ErrorPopup"
                AutomationProperties.AutomationId="ErrorPopup"
                IsOpen="False"
                Width="{Binding Path=ActualWidth, ElementName=InputField}"
                PlacementTarget="{Binding ElementName=InputField}"
                Placement="Top">
                <Border
                    Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
                    Padding="2"
                    BorderBrush="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"
                    BorderThickness="2">
                    <local:AutomationTextBlock
                        x:Name="txtError"
                        Text="{Binding Path=(AutomationProperties.HelpText), ElementName=InputField}"
                        Focusable="False"
                        TextWrapping="Wrap" />
                </Border>
            </local:DismissiblePopup>

        </StackPanel>

        <DataTemplate.Triggers>

            <!--Show Error Icon When Input Is Invalid-->
            <Trigger SourceName="InputField"
                     Property="Validation.HasError"
                     Value="True">
                <Setter TargetName="ErrorGraphics"
                        Property="Visibility"
                        Value="Visible" />
            </Trigger>

            <!--Show error popup when input is invalid and when the mouse is over the textbox-->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition
                        Binding="{Binding Path=Error, Converter={StaticResource IsValidatingValueValidConverter}}"
                        Value="False" />
                    <Condition
                        Binding="{Binding Path=IsMouseOver, ElementName=InputField}"
                        Value="True" />
                </MultiDataTrigger.Conditions>

                <Setter
                    TargetName="ErrorPopup"
                    Property="IsOpen"
                    Value="True" />
            </MultiDataTrigger>

            <!--Show error popup when input is invalid and when the textbox has focus-->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition
                        Binding="{Binding Path=Error, Converter={StaticResource IsValidatingValueValidConverter}}"
                        Value="False" />
                    <Condition
                        Binding="{Binding Path=IsFocused, ElementName=InputField}"
                        Value="True" />
                </MultiDataTrigger.Conditions>

                <Setter
                    TargetName="ErrorPopup"
                    Property="IsOpen"
                    Value="True" />
            </MultiDataTrigger>

        </DataTemplate.Triggers>
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=IsBetweenRuleTemplate}">
        <StackPanel Orientation="Horizontal">
            <local:FilterRulePanelContentPresenter Content="{Binding Path=StartValue}" />

            <local:FilterRulePanelContentPresenter Content="{Binding Path=EndValue}" />
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:FilterRulePanel}, ResourceId=FilterRulePanelGroupItemTypeTemplate}">

        <local:AutomationTextBlock VerticalAlignment="Center" Margin="5,0,4,0"  x:Name="LogicalOperator" />

        <DataTemplate.Triggers>
            <DataTrigger
                Binding="{Binding}"
                Value="{x:Static local:FilterRulePanelItemType.FirstHeader}">
                <Setter
                    Property="Text"
                    Value="{x:Static default:XamlLocalizableResources.FilterRulePanel_LogicalOperatorText_FirstHeader}"
                    TargetName="LogicalOperator" />
            </DataTrigger>

            <DataTrigger
                Binding="{Binding}"
                Value="{x:Static local:FilterRulePanelItemType.Header}">
                <Setter
                    Property="Text"
                    Value="{x:Static default:XamlLocalizableResources.FilterRulePanel_LogicalOperatorText_Header}"
                    TargetName="LogicalOperator" />
            </DataTrigger>

            <DataTrigger
                Binding="{Binding}"
                Value="{x:Static local:FilterRulePanelItemType.Item}">
                <Setter
                    Property="Text"
                    Value="{x:Static default:XamlLocalizableResources.FilterRulePanel_LogicalOperatorText_Item}"
                    TargetName="LogicalOperator" />
                <Setter
                    TargetName="LogicalOperator"
                    Property="Margin"
                    Value="13, 0, 4, 0" />
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

    <!--=================================================================
            Filter Rule Panel
        ==================================================================-->

    <Style TargetType="{x:Type local:FilterRulePanel}">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="AutomationProperties.Name" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_FilterRulePanel_AutomationPropertiesName_257}" />
        <Setter Property="AutomationProperties.AutomationId" Value="FilterRulePanel" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:FilterRulePanel}">
                    <!--Adding AdornerDecorator with implicit style for Control to fix Win7 bug 393988-->
                    <AdornerDecorator>
                        <AdornerDecorator.Resources>
                            <Style
                                TargetType="Control">
                                <Setter
                                    Property="Focusable"
                                    Value="False" />
                            </Style>
                        </AdornerDecorator.Resources>
                        <Border Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <ItemsControl
                                x:Name="list"
                                IsTabStop="False"
                                ItemsSource="{Binding Path=FilterRulePanelItems, RelativeSource={RelativeSource TemplatedParent}}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <local:AutomationGroup
                                            x:Name="FilterRulePanelItem"
                                            AutomationProperties.Name="{Binding Path=Rule.DisplayName, StringFormat={x:Static default:XamlLocalizableResources.FilterRule_AccessibleName}}"
                                            IsTabStop="False">
                                            <Grid Margin="0, 1">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto" />
                                                    <ColumnDefinition />
                                                </Grid.ColumnDefinitions>

                                                <ContentPresenter Content="{Binding Path=ItemType}"
                                                                  VerticalAlignment="Top"
                                                                  Margin="0,5,0,0"
                                                                  ContentTemplateSelector="{Binding Path=FilterRuleTemplateSelector, RelativeSource={RelativeSource AncestorType={x:Type local:FilterRulePanel}}}" />

                                                <ContentPresenter Grid.Column="1"
                                                                  Content="{Binding Path=Rule}"
                                                                  ContentTemplateSelector="{Binding Path=FilterRuleTemplateSelector, RelativeSource={RelativeSource AncestorType={x:Type local:FilterRulePanel}}}" />
                                            </Grid>
                                        </local:AutomationGroup>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </Border>
                    </AdornerDecorator>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=Items.Count, ElementName=list}" Value="0">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="list" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            Inner List Xaml
        ==================================================================-->

    <!--MenuItem Style definition -->
    <ControlTemplate x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}"
                     TargetType="MenuItem">
        <Border Name="Border">
            <Grid>
                <ContentPresenter Margin="6,3,6,3"
                                  ContentSource="Header"
                                  RecognizesAccessKey="True" />
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsHighlighted"
                     Value="true">
                <Setter TargetName="Border"
                        Property="Background"
                        Value="{StaticResource NormalBrush}" />
                <Setter TargetName="Border"
                        Property="BorderBrush"
                        Value="Transparent" />
            </Trigger>
            <Trigger Property="IsEnabled"
                     Value="False">
                <Setter Property="Foreground"
                        Value="{StaticResource DisabledForegroundBrush}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="InnerListColumnHeader_Gripper_Style"
           TargetType="{x:Type Thumb}">
        <Setter Property="Canvas.Right"
                Value="-9" />
        <Setter Property="FrameworkElement.Width"
                Value="18" />
        <Setter Property="FrameworkElement.Height"
                Value="{Binding ActualHeight, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
        <Setter Property="Panel.Background"
                Value="Transparent" />
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Border Padding="{TemplateBinding Control.Padding}"
                            Background="{TemplateBinding Panel.Background}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <local:ScalableImageSource x:Key="SortGlyph_Ascending_Source"
                               AccessibleName="{x:Static default:XamlLocalizableResources.ManagementList_SortGlyph_Ascending_AutomationName}"
                               Size="6,6">
        <local:ScalableImageSource.Image>
            <DrawingImage>
                <DrawingImage.Drawing>
                    <GeometryDrawing Brush="{x:Static SystemColors.ControlDarkBrush}">
                        <GeometryDrawing.Geometry>
                            <PathGeometry>
                                <PathGeometry.Transform>
                                    <TranslateTransform Y="2" />
                                </PathGeometry.Transform>
                                <PathFigure>
                                    <LineSegment Point="0,3"></LineSegment>
                                    <LineSegment Point="3,0"></LineSegment>
                                    <LineSegment Point="6,3"></LineSegment>
                                    <LineSegment Point="0,3"></LineSegment>
                                </PathFigure>
                            </PathGeometry>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                </DrawingImage.Drawing>
            </DrawingImage>
        </local:ScalableImageSource.Image>
    </local:ScalableImageSource>

    <local:ScalableImageSource x:Key="SortGlyph_Descending_Source"
                               AccessibleName="{x:Static default:XamlLocalizableResources.ManagementList_SortGlyph_Descending_AutomationName}"
                               Size="6,6">
        <local:ScalableImageSource.Image>
            <DrawingImage>
                <DrawingImage.Drawing>
                    <GeometryDrawing Brush="{x:Static SystemColors.ControlDarkBrush}">
                        <GeometryDrawing.Geometry>
                            <PathGeometry>
                                <PathGeometry.Transform>
                                    <TranslateTransform Y="2" />
                                </PathGeometry.Transform>
                                <PathFigure>
                                    <LineSegment Point="0,0"></LineSegment>
                                    <LineSegment Point="3,3"></LineSegment>
                                    <LineSegment Point="6,0"></LineSegment>
                                </PathFigure>
                            </PathGeometry>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>
                </DrawingImage.Drawing>
            </DrawingImage>
        </local:ScalableImageSource.Image>
    </local:ScalableImageSource>


    <!--Inner List Default Styles-->
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ManagementList}, ResourceId=ManagementListDefaultInnerListStyle}"
           TargetType="{x:Type local:InnerList}">
        <Style.Resources>
            <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TextTrimmedTextBlockStyle}"/>
        </Style.Resources>

        <Setter Property="TextSearch.TextPath"
                Value="Name" />
        <Setter Property="AutomationProperties.Name" Value="{Binding Path=(AutomationProperties.Name), RelativeSource={RelativeSource AncestorType={x:Type local:ManagementList}}}" />
    </Style>

    <!--Style definition specially for column header -->
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ManagementList}, ResourceId=ManagementList_GridViewColumnHeader_Style}"
           TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="Background"
                Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
        <Setter Property="BorderBrush"
                Value="{x:Static classictheme:ClassicBorderDecorator.ClassicBorderBrush}" />
        <Setter Property="BorderThickness"
                Value="2" />
        <Setter Property="MinHeight"
                Value="17" />
        <Setter Property="Focusable" Value="True" />
        <Setter Property="IsTabStop" Value="True" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="Padding"
                Value="5,0,5,0" />
        <Setter Property="Foreground"
                Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                    <Grid SnapsToDevicePixels="True">
                        <classictheme:ClassicBorderDecorator x:Name="HeaderBorder"
                                                             BorderStyle="Raised"
                                                             BorderThickness="{TemplateBinding Border.BorderThickness}"
                                                             BorderBrush="{TemplateBinding Border.BorderBrush}"
                                                             Background="{TemplateBinding Panel.Background}">
                            <ContentPresenter RecognizesAccessKey="True"
                                              x:Name="HeaderContent"
                                              Margin="{TemplateBinding Padding}"
                                              Content="{TemplateBinding ContentControl.Content}"
                                              ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                                              HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
                                              SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}">
                                <ContentPresenter.Resources>
                                    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource TextTrimmedTextBlockStyle}"/>
                                </ContentPresenter.Resources>
                            </ContentPresenter>
                        </classictheme:ClassicBorderDecorator>


                        <!-- Sort Glyph -->
                        <local:ScalableImage x:Name="PART_SortAdorner"
                                             VerticalAlignment="Top"
                                             Margin="1"
                                             Visibility="Hidden"
                                             Source="{StaticResource SortGlyph_Ascending_Source}" />

                        <Canvas>
                            <Thumb Name="PART_HeaderGripper"
                                   Style="{StaticResource InnerListColumnHeader_Gripper_Style}" />
                        </Canvas>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- Disable the header if there is no content. This prevents the empty final column from getting focus or having visual effects. -->
                        <Trigger Property="ContentControl.HasContent" Value="False">
                            <Setter Property="UIElement.IsEnabled" Value="False" />
                        </Trigger>
                        <Trigger Property="UIElement.IsEnabled"
                                 Value="False">
                            <Setter Property="TextElement.Foreground"
                                    Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                        </Trigger>
                        <Trigger Property="local:InnerList.IsPrimarySortColumn"
                                 Value="True">
                            <Setter TargetName="PART_SortAdorner"
                                    Property="Visibility"
                                    Value="Visible" />
                            <Setter Property="AutomationProperties.ItemStatus"
                                    Value="{x:Static default:XamlLocalizableResources.InnerList_GridViewColumnHeader_ItemStatus_Ascending}" />
                        </Trigger>
                        <DataTrigger Binding="{Binding Path=DataDescription.SortDirection}"
                                     Value="Descending">
                            <Setter TargetName="PART_SortAdorner"
                                    Property="Source"
                                    Value="{StaticResource SortGlyph_Descending_Source}" />
                            <Setter Property="AutomationProperties.ItemStatus"
                                    Value="{x:Static default:XamlLocalizableResources.InnerList_GridViewColumnHeader_ItemStatus_Descending}" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            List Organizer Item Style
        ==================================================================-->

    <Style TargetType="{x:Type local:ListOrganizerItem}">
        <Setter Property="IsTabStop" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ListOrganizerItem}">
                    <Grid x:Name="Container"
                        Background="{StaticResource AlmostInvisibleBackgroundBrush}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <local:AutomationButton x:Name="PART_DeleteButton"
                            Command="{x:Static local:ListOrganizer.DeleteItemCommand}"
                            CommandParameter="{Binding}"
                            CommandTarget="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ListOrganizer}}}"
                            AutomationProperties.Name="{Binding Path=(AutomationProperties.Name), ElementName=DeleteImage}"
                            Grid.Column="2"
                            ToolTip="{Binding Path=(AutomationProperties.Name), ElementName=DeleteImage}"
                            IsTabStop="false"
                            Padding="4"
                            VerticalContentAlignment="Stretch"
                            HorizontalContentAlignment="Stretch"
                            OverridesDefaultStyle="true"
                            Template="{StaticResource EmptyButton}"
                            Opacity="0.4">

                            <local:ScalableImage x:Name="DeleteImage"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center">
                                <local:ScalableImage.Source>
                                    <local:ScalableImageSource
                                        AccessibleName="{x:Static default:XamlLocalizableResources.AutoResXGen_ListOrganizer_AutomationPropertiesName_47}"
                                        Size="9, 9"
                                        Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/Delete16.png" />
                                </local:ScalableImage.Source>
                            </local:ScalableImage>
                        </local:AutomationButton>

                        <ToggleButton x:Name="PART_RenameButton"
                            AutomationProperties.Name="{Binding Path=(AutomationProperties.Name), ElementName=RenameImage}"
                            Grid.Column="1"
                            ToolTip="{Binding Path=(AutomationProperties.Name), ElementName=RenameImage}"
                            IsTabStop="false"
                            Padding="3"
                            VerticalContentAlignment="Stretch"
                            HorizontalContentAlignment="Stretch"
                            OverridesDefaultStyle="true"
                            Template="{StaticResource EmptyButton}"
                            Opacity="0.4">

                            <local:ScalableImage x:Name="RenameImage"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center">

                                <local:ScalableImage.Source>
                                    <local:ScalableImageSource
                                        AccessibleName="{x:Static default:XamlLocalizableResources.AutoResXGen_ListOrganizer_AutomationPropertiesName_72}"
                                        Size="16, 16"
                                        Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/Rename16.png" />
                                </local:ScalableImage.Source>
                            </local:ScalableImage>
                        </ToggleButton>

                        <local:AutomationButton x:Name="PART_LinkButton"
                            Background="Pink"
                            Grid.Column="0"
                            Command="{x:Static local:ListOrganizer.SelectItemCommand}"
                            CommandParameter="{Binding}"
                            CommandTarget="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ListOrganizer}}}"
                            IsTabStop="false"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Stretch"
                            Cursor="Hand"
                            OverridesDefaultStyle="true"
                            Padding="5"
                            Template="{StaticResource EmptyButton}">
                        </local:AutomationButton>

                        <TextBox x:Name="PART_EditBox"
                            AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_ListOrganizer_AutomationPropertiesName_95}"
                            Grid.Column="0"
                            Visibility="Collapsed"
                            Margin="0, 2, 5, 2" />
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="ToggleButton.IsChecked"
                            SourceName="PART_RenameButton"
                            Value="True">
                            <Setter TargetName="PART_LinkButton"
                                Property="Visibility"
                                Value="Collapsed" />

                            <Setter TargetName="PART_EditBox"
                                Property="Visibility"
                                Value="Visible" />
                        </Trigger>

                        <Trigger Property="IsMouseOver"
                            SourceName="Container"
                            Value="True">

                            <Setter Property="Opacity"
                                Value="1"
                                TargetName="PART_RenameButton" />

                            <Setter Property="Opacity"
                                Value="1"
                                TargetName="PART_DeleteButton" />
                        </Trigger>

                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}"
                            Value="True">

                            <Setter Property="Opacity"
                                Value="1"
                                TargetName="PART_RenameButton" />

                            <Setter Property="Opacity"
                                Value="1"
                                TargetName="PART_DeleteButton" />
                        </DataTrigger>

                        <DataTrigger Value="true">
                            <DataTrigger.Binding>
                                <MultiBinding Converter="{StaticResource IsEqualConverter}">
                                    <Binding Path="DataContext" RelativeSource="{RelativeSource Self}" />
                                    <Binding Path="HighlightedItem" RelativeSource="{RelativeSource AncestorType={x:Type local:ListOrganizer}}" />
                                </MultiBinding>
                            </DataTrigger.Binding>
                            <Setter Property="FontWeight" Value="Bold" TargetName="PART_LinkButton" />
                        </DataTrigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            List Organizer Style
        ==================================================================-->

    <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ListOrganizer}, ResourceId=ListOrganizerItemTemplateKey}"
        TargetType="{x:Type ListBoxItem}">

        <local:ListOrganizerItem
            TextContentPropertyName="{Binding Path=TextContentPropertyName, RelativeSource={RelativeSource AncestorType={x:Type local:ListOrganizer}}}" />
    </ControlTemplate>

    <DataTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ListOrganizer}, ResourceId=ListOrganizerDropDownTemplateKey}">
        <Border Style="{StaticResource General_PopUp_OuterBorder}">
            <Border Style="{StaticResource General_PopUp_MiddleBorder}">
                <Border Style="{StaticResource General_PopUp_InnerBorder}">
                    <Grid >
                        <ListBox Name="PART_ListBox"
                            AutomationProperties.AutomationId="ListOrganizerItemsContainer"
                    VerticalAlignment="Stretch"
                    HorizontalContentAlignment="Stretch"
                    BorderThickness="0"
                    ItemsSource="{Binding Path=ItemsSource, RelativeSource={RelativeSource AncestorType={x:Type local:ListOrganizer}}}">

                            <ListBox.Resources>
                                <Style x:Key="{x:Type ListBoxItem}"
                            TargetType="{x:Type ListBoxItem}">

                                    <!-- By default, bind the automation name to a 'Name' property on the data. If the solution needs a different property, they need to override this style. -->
                                    <Setter Property="AutomationProperties.Name" Value="{Binding Path=Name}" />

                                    <Setter Property="HorizontalContentAlignment"
                                Value="{Binding Path=HorizontalContentAlignment,RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
                                    <Setter Property="VerticalContentAlignment"
                                Value="{Binding Path=VerticalContentAlignment,RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
                                    <Setter Property="Padding"
                                Value="2,0,0,0" />
                                    <Setter Property="IsTabStop"
                                Value="true" />
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <StaticResource ResourceKey="{ComponentResourceKey ResourceId=ListOrganizerItemTemplateKey, TypeInTargetAssembly=local:ListOrganizer}" />
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </ListBox.Resources>
                        </ListBox>

                        <local:AutomationTextBlock x:Name="NoItemsText"
                    Text="{Binding Path=NoItemsText, RelativeSource={RelativeSource AncestorType={x:Type local:ListOrganizer}}}"
                    Visibility="Collapsed"
                    HorizontalAlignment="Center"
                    Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"
                    VerticalAlignment="Center" />

                    </Grid>
                </Border>
            </Border>
        </Border>

        <DataTemplate.Triggers>

            <DataTrigger Binding="{Binding Path=Items.Count, ElementName=PART_ListBox}"
                Value="0">

                <Setter TargetName="PART_ListBox"
                    Property="Visibility"
                    Value="Collapsed" />

                <Setter TargetName="NoItemsText"
                    Property="Visibility"
                    Value="Visible" />
            </DataTrigger>
        </DataTemplate.Triggers>

    </DataTemplate>

    <Style TargetType="{x:Type local:ListOrganizer}">
        <Setter Property="IsTabStop"
            Value="false" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ListOrganizer}">
                    <local:PickerBase x:Name="PART_Picker"
                        AutomationProperties.Name="{Binding Path=(AutomationProperties.Name), RelativeSource={RelativeSource TemplatedParent}}"
                        AutomationProperties.AutomationId="{Binding Path=(AutomationProperties.AutomationId), RelativeSource={RelativeSource TemplatedParent}}"
                        DropDownStyle="{TemplateBinding DropDownStyle}"
                        Header="{TemplateBinding Content}"
                        HeaderTemplate="{TemplateBinding ContentTemplate}"
                        Foreground="{TemplateBinding Foreground}"
                        ContentTemplate="{StaticResource ResourceKey={ComponentResourceKey ResourceId=ListOrganizerDropDownTemplateKey, TypeInTargetAssembly=local:ListOrganizer}}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            Management List Xaml
        ==================================================================-->

    <!--Show Filter Panel Toggle Button Style-->
    <Style x:Key="ManagementList_ShowFilterPanel_ToggleButton_Style"
           TargetType="{x:Type ToggleButton}"
           BasedOn="{StaticResource ExpanderButton_Style}">
        <Setter Property="AutomationProperties.Name" Value="{x:Static default:XamlLocalizableResources.ManagementList_ToggleFilterPanelButton_AutomationName}" />
        <Setter Property="Margin"
                Value="5,0,5,0" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="IsChecked" Value="True" />
        <Style.Triggers>
            <Trigger Property="ToggleButton.IsChecked" Value="False">
                <Setter Property="ToolTip" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_ToolTip_32}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--View Manager Style-->
    <Style x:Key="ManagementList_ViewManager_ListOrganizer_Style"
           TargetType="{x:Type local:ListOrganizer}"
           BasedOn="{StaticResource {x:Type local:ListOrganizer}}">
        <Setter Property="Content" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_Content_33}" />
        <Setter Property="ItemsSource"
                Value="{Binding Path=Views, RelativeSource={RelativeSource AncestorType={x:Type local:ManagementList}}}" />
        <Setter Property="HighlightedItem"
                Value="{Binding Path=CurrentView, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type local:ManagementList}}}" />
        <Setter Property="TextContentPropertyName"
                Value="Name" />
        <Setter Property="NoItemsText" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_NoItemsText_50}" />

        <Setter Property="AutomationProperties.Name" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_AutomationPropertiesName_52}" />
        <Setter Property="AutomationProperties.AutomationId"
                Value="SavedViewsButton" />
        <Setter Property="DropDownStyle">
            <Setter.Value>
                <Style TargetType="{x:Type Popup}">
                    <Setter Property="AutomationProperties.AutomationId" Value="SavedViewsDropDown" />
                    <Setter Property="MinWidth" Value="200" />
                    <Setter Property="MinHeight" Value="150" />
                    <Setter Property="MaxWidth" Value="300" />
                    <Setter Property="MaxHeight" Value="400" />
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="5,2,5,2">
                        <TextBlock x:Name="QueryText"  VerticalAlignment="Center" Text="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_Content_33}" />

                        <!--Arrow Glyph-->
                        <Path x:Name="ViewSave_ArrowDown" Style="{StaticResource GeneralArrowStyleDown}" Margin="10,0,0,0"/>

                    </StackPanel>

                    <DataTemplate.Triggers>
                        <DataTrigger
                            Binding="{Binding Path=IsEnabled, RelativeSource={RelativeSource TemplatedParent}}"
                            Value="False">
                            <Setter
                                Property="Foreground"
                                TargetName="QueryText"
                                Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="Dimming_Image_Style"
           TargetType="{x:Type local:ScalableImage}">
        <Style.Triggers>
            <Trigger
                Property="IsEnabled"
                Value="False">
                <Setter Property="Opacity"
                        Value="0.5" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- Start Filter Button Style-->
    <Style x:Key="ManagementList_StartFilter_Button_Style" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="2,0,5,0">

                        <local:ScalableImage Style="{StaticResource Dimming_Image_Style}"  Margin="1,2,5,0" >
                            <local:ScalableImage.Source>
                                <local:ScalableImageSource Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/SpyGlass16.png" Size="16,16" />
                            </local:ScalableImage.Source>
                        </local:ScalableImage>

                        <TextBlock VerticalAlignment="Center" Text="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList_TextBlock_83}"/>
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="AutomationProperties.Name" Value="{x:Static default:XamlLocalizableResources.ManagementList_StartFilterButton_AutomationName}" />
        <Setter Property="Command" Value="{x:Static local:ManagementList.StartFilterCommand}" />
        <Setter Property="MinWidth" Value="75" />
    </Style>

    <!-- Stop Filter Button Style-->
    <Style x:Key="ManagementList_StopFilter_Button_Style" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="2,0,5,0">

                        <local:ScalableImage Style="{StaticResource Dimming_Image_Style}"  Margin="1,2,5,0" >
                            <local:ScalableImage.Source>
                                <local:ScalableImageSource Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/CloseTile16.png" Size="16,16" />
                            </local:ScalableImage.Source>
                        </local:ScalableImage>

                        <TextBlock VerticalAlignment="Center" Text="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList_TextBlock_106}"/>
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="AutomationProperties.Name" Value="{x:Static default:XamlLocalizableResources.ManagementList_StopFilterButton_AutomationName}" />
        <Setter Property="Command" Value="{x:Static local:ManagementList.StopFilterCommand}" />
        <Setter Property="MinWidth" Value="75" />
    </Style>

    <!--Clear Filter Style-->
    <Style x:Key="ManagementList_ClearFilter_Button_Style" TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal" Margin="2,0,5,0">

                        <local:ScalableImage Margin="1,3,5,1" Style="{StaticResource Dimming_Image_Style}">
                            <local:ScalableImage.Source>
                                <local:ScalableImageSource Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/Delete16.png" Size="14,14" />
                            </local:ScalableImage.Source>
                        </local:ScalableImage>

                        <TextBlock VerticalAlignment="Center" Text="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList_TextBlock_129}"/>
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>

        <Setter Property="ToolTip" Value="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_ToolTip_104}" />

        <Setter Property="Command" Value="{x:Static local:ManagementList.ClearFilterCommand}" />

        <Setter Property="AutomationProperties.AutomationId" Value="CancelFilterButton" />

        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Visibility" Value="Collapsed" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- DimmingGeneralArrowStyleDown -->
    <Style
        x:Key="DimmingGeneralArrowStyleDown"
        TargetType="{x:Type Path}"
        BasedOn="{StaticResource GeneralArrowStyleDown}">
        <Style.Triggers>
            <Trigger
                Property="IsEnabled"
                Value="False">
                <Setter
                    Property="Opacity"
                    Value="0.5" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--Save View Header Template-->
    <DataTemplate x:Key="ManagementList_SaveView_Header_Template">
        <StackPanel Orientation="Horizontal" Margin="2,0,5,0">

            <!--Save Glyph-->
            <local:ScalableImage Style="{StaticResource Dimming_Image_Style}">
                <local:ScalableImage.Source>
                    <local:ScalableImageSource Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/Save16.png" Size="14,14" />
                </local:ScalableImage.Source>
            </local:ScalableImage>

            <!--Arrow Glyph-->
            <Path x:Name="ViewSave_ArrowDown" Style="{StaticResource DimmingGeneralArrowStyleDown}" Margin="10,0,0,0"/>

        </StackPanel>
    </DataTemplate>

    <!--Save View Content Template-->
    <DataTemplate x:Key="ManagementList_SaveView_Content_Template">
        <Border Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
                    BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"
                    BorderThickness="1"
                    CornerRadius="2"
                    Padding="2,4,2,0">

            <StackPanel>
                <!--Info Text-->
                <local:AutomationTextBlock Text="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_Text_166}"
                                         Foreground="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
                                         TextWrapping="Wrap"
                                         AutomationProperties.AutomationId="SaveViewsPromptText"
                                         Margin="2" />

                <!--Name Of View TextBox-->
                <TextBox x:Name="PART_ViewNameTextBox"
                             AutomationProperties.Name="{Binding Path=Text, ElementName=PART_ViewNameTextBox}"
                             Margin="2">
                    <TextBox.Text>
                        <MultiBinding Converter="{StaticResource NewQueryStringConverter}">
                            <Binding Path="CurrentView.Name" UpdateSourceTrigger="PropertyChanged" RelativeSource="{RelativeSource AncestorType={x:Type local:ManagementList}}" />
                        </MultiBinding>
                    </TextBox.Text>
                </TextBox>

                <Grid Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Rectangle HorizontalAlignment="Stretch"
                                   Height="3"
                                   Grid.ColumnSpan="2">
                        <Rectangle.Fill>
                            <LinearGradientBrush StartPoint="0.5,1.0"
                                                     EndPoint="0.5,0.0">
                                <GradientStop Color="#88000000"
                                                  Offset="0" />
                                <GradientStop Color="#00000000"
                                                  Offset="1" />
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>

                    <!--Ok Button-->
                    <local:AutomationButton Grid.Row="1"
                            HorizontalAlignment="Right"
                            Content="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_Content_186}"
                            IsDefault="true"
                            Command="local:ManagementList.SaveViewCommand"
                            CommandParameter="{Binding Path=Text, ElementName=PART_ViewNameTextBox}"
                            AutomationProperties.AutomationId="OkButton"
                            MinWidth="75"
                            Margin="5,3,5,3" />

                    <!--Cancel Button-->
                    <local:AutomationButton Grid.Column="1"
                            Grid.Row="1"
                            Content="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_Content_196}"
                            IsCancel="True"
                            Command="local:PickerBase.CloseDropDownCommand"
                            CommandTarget="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:PickerBase}}}"
                            AutomationProperties.AutomationId="CancelButton"
                            MinWidth="75"
                            Margin="15,3,5,3" />
                </Grid>
            </StackPanel>
        </Border>
    </DataTemplate>

    <!--Save View Style-->
    <Style x:Key="ManagementList_SaveView_PickerBase_Style" TargetType="{x:Type local:PickerBase}">
        <Setter Property="HeaderTemplate" Value="{StaticResource ManagementList_SaveView_Header_Template}" />
        <Setter Property="ContentTemplate" Value="{StaticResource ManagementList_SaveView_Content_Template}" />
        <Setter Property="Margin" Value="1,0,0,0" />

        <Setter Property="AutomationProperties.AutomationId" Value="SaveViewButton" />
        <Setter Property="DropDownStyle">
            <Setter.Value>
                <Style TargetType="{x:Type Popup}">
                    <Setter Property="AutomationProperties.AutomationId" Value="SaveViewDropDown" />
                    <Setter Property="MaxWidth" Value="300" />
                </Style>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Search container style -->
    <Style x:Key="SearchContainer_Style" TargetType="{x:Type Border}">
        <!-- This negative margin is needed in order to not get a 1 px semi transparent line between title and search. Don't know why. -->
        <Setter Property="Margin" Value="0,-1,0,0"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=IsFilterShown, RelativeSource={RelativeSource AncestorType={x:Type local:ManagementList}}}" Value="True">
                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <!-- Filter panel container style -->
    <Style x:Key="FilterPanelContainer_Style" TargetType="{x:Type Grid}">
        <!-- This negative margin is needed in order to not get a 1 px semi transparent line between title and search. -->
        <Setter Property="Margin" Value="0,-1,0,0"/>
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
    </Style>

    <Style TargetType="{x:Type local:ManagementList}">
        <Style.Resources>

            <Style TargetType="ListViewItem">
                <Setter Property="AutomationProperties.AutomationId"
                        Value="ListViewItem" />

                <!-- By default, bind the automation name to a 'Name' property on the data. If the solution needs a different property, they need to override this style. -->
                <Setter Property="AutomationProperties.Name"
                        Value="{Binding Path=Name}" />
            </Style>

            <Style TargetType="{x:Type local:InnerList}"
                   BasedOn="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:ManagementList}, ResourceId=ManagementListDefaultInnerListStyle}}" >
                <Setter Property="Margin" Value="3,0,3,0"/>
            </Style>

            <Style TargetType="{x:Type local:SearchBox}">
                <Style.Triggers>
                    <!-- Change the default searchbox background text to "Filter" for "live" mode -->
                    <DataTrigger Binding="{Binding Evaluator.StartFilterOnExpressionChanged, RelativeSource={RelativeSource AncestorType={x:Type local:ManagementList}}}" Value="True">
                        <Setter Property="BackgroundText" Value="{x:Static default:XamlLocalizableResources.ManagementList_SearchBox_BackgroundText_Live}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <!-- Default style for the Rule Picker -->
            <Style TargetType="{x:Type local:AddFilterRulePicker}">
                <Setter Property="AddFilterRulesCommand"
                        Value="{x:Static local:FilterRulePanel.AddRulesCommand}" />
                <Setter Property="AddFilterRulesCommandTarget"
                        Value="{Binding Path=FilterRulePanel, RelativeSource={RelativeSource AncestorType={x:Type local:ManagementList}}}" />
                <Setter Property="ToolTip"
                        Value="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_ToolTip_132}" />
                <Setter Property="Margin"
                        Value="0,0,5,0" />
                <Setter Property="AutomationProperties.AutomationId"
                        Value="AddSearchCriteriaButton" />
            </Style>

            <Style TargetType="{x:Type GridViewColumnHeader}"
                   BasedOn="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type local:ManagementList}, ResourceId=ManagementList_GridViewColumnHeader_Style}}" />
        </Style.Resources>

        <Setter
            Property="MinWidth"
            Value="300" />

        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="AutomationProperties.AutomationId" Value="ManagementList" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ManagementList}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <!--Search Box, Show Query ToggleButton, Views DropDown-->
                        <Border x:Name="SearchBG" Style="{StaticResource SearchContainer_Style}">
                            <Grid Margin="3, 2, 3, 4">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>

                                <!--Search Box-->
                                <ContentPresenter
                                    x:Name="PART_SearchBox"
                                    Content="{TemplateBinding SearchBox}">
                                    <ContentPresenter.InputBindings>
                                        <KeyBinding Command="{x:Static local:ManagementList.StartFilterCommand}" Key="Enter" />
                                        <KeyBinding Command="{x:Static local:ManagementList.StopFilterCommand}" Key="Escape" />
                                    </ContentPresenter.InputBindings>
                                </ContentPresenter>

                                <Grid
                                    x:Name="PART_SearchButtonsContainer"
                                    Grid.Column="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <!-- Start Filter Button-->
                                    <local:AutomationButton
                                        x:Name="PART_StartFilterButton"
                                        Margin="1,0,7,0"
                                        Style="{StaticResource ManagementList_StartFilter_Button_Style}" />

                                    <!-- Stop Filter Button-->
                                    <local:AutomationButton
                                        x:Name="PART_StopFilterButton"
                                        Grid.Column="1"
                                        Margin="1,0,7,0"
                                        Visibility="Collapsed"
                                        Style="{StaticResource ManagementList_StopFilter_Button_Style}" />

                                    <!--Views DropDown-->
                                    <local:ListOrganizer x:Name="PART_ViewManager"
                                                     ToolTip="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList_ToolTip_314}"
                                                     Margin="5,0,0,0"
                                                     Grid.Column="2"
                                                     Style="{StaticResource ManagementList_ViewManager_ListOrganizer_Style}" />

                                    <!--Save View Picker-->
                                    <local:PickerBase x:Name="PART_ViewSaver"
                                                    Grid.Column="3"
                                                      ToolTip="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_AutomationPropertiesName_314}"
                                                  AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList2_AutomationPropertiesName_314}"
                                                  Style="{StaticResource ManagementList_SaveView_PickerBase_Style}" />

                                    <!--Show Query ToggleButton-->
                                    <local:ExpanderButton x:Name="buttonShowFilterPanel"  Grid.Column="4"
                                              Style="{StaticResource ManagementList_ShowFilterPanel_ToggleButton_Style}" />

                                </Grid>

                            </Grid>
                        </Border>

                        <!--FilterPanel, Add Criteria, Filter Description, Clear Filter Button-->
                        <Grid x:Name="filterPanelRow" Grid.Row="1"
                              Style="{StaticResource FilterPanelContainer_Style}">

                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <!--Filter Panel-->
                            <ScrollViewer
                                x:Name="PART_FilterPanelScroller"
                                Visibility="Collapsed"
                                MaxHeight="200"
                                Margin="5,2,5,2"
                                VerticalScrollBarVisibility="Auto"
                                HorizontalScrollBarVisibility="Disabled">
                                <ContentPresenter
                                    x:Name="PART_FilterRulePanel"
                                    Content="{TemplateBinding FilterRulePanel}">
                                    <ContentPresenter.InputBindings>
                                        <KeyBinding Command="{x:Static local:ManagementList.StartFilterCommand}" Key="Enter" />
                                    </ContentPresenter.InputBindings>
                                </ContentPresenter>
                            </ScrollViewer>

                            <StackPanel
                                Orientation="Horizontal"
                                Grid.Row="1"
                                Margin="4,0,0,4">
                                <!--Add Criteria Picker-->
                                <ContentPresenter x:Name="addFilterRulePanelCriteriaButton"
                                                  Visibility="Collapsed"
                                                  Content="{TemplateBinding AddFilterRulePicker}" />

                                <!-- Filter Description -->
                                <TextBlock
                                    x:Name="PART_FilterDescription"
                                    Margin="0,7,7,5"
                                    VerticalAlignment="Top"
                                    Text="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList_Text_392}"/>

                                <!-- Clear Filter Button-->
                                <local:AutomationButton x:Name="PART_ClearAllButton"
                                        VerticalAlignment="Bottom"
                                        AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_ManagementList_AutomationPropertiesName_395}"
                                        Style="{StaticResource ManagementList_ClearFilter_Button_Style}" />

                            </StackPanel>
                        </Grid>

                        <!-- Progress Indicator -->
                        <local:WaitRing
                            x:Name="PART_ProgressIndicator"
                            Width="25"
                            Height="25"
                            Margin="0,40,0,0"
                            Grid.Row="3"
                            VerticalAlignment="Top"
                            HorizontalAlignment="Center"
                            Visibility="Collapsed"
                            Panel.ZIndex="1" />

                        <!--No Matches Found Message-->
                        <local:AutomationTextBlock
                            x:Name="PART_NoMatchesFoundMessage"
                            Grid.Row="3"
                            Text="{x:Static default:XamlLocalizableResources.ManagementList_NoMatchesFound_Message}"
                            FontStyle="Italic"
                            TextTrimming="None"
                            TextWrapping="Wrap"
                            Margin="0, 40, 0, 0"
                            VerticalAlignment="Top"
                            HorizontalAlignment="Center"
                            Visibility="Collapsed"
                            Panel.ZIndex="1" />

                        <!--Inner List-->
                        <ContentPresenter x:Name="PART_InnerList" Content="{TemplateBinding List}"
                                          Grid.Row="3"
                                          Width="Auto"/>

                    </Grid>

                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=IsChecked, ElementName=buttonShowFilterPanel}" Value="True">
                            <Setter TargetName="PART_FilterPanelScroller" Property="Visibility" Value="Visible" />
                            <Setter TargetName="addFilterRulePanelCriteriaButton" Property="Visibility" Value="Visible" />
                            <Setter TargetName="PART_FilterDescription" Property="Visibility" Value="Collapsed" />
                        </DataTrigger>

                        <!-- Hide the Clear All button if the filter panel is collapsed and the filter isn't applied -->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=IsChecked, ElementName=buttonShowFilterPanel}" Value="False" />
                                <Condition Binding="{Binding Path=Evaluator.FilterStatus, RelativeSource={RelativeSource Self}}" Value="NotApplied" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter TargetName="PART_ClearAllButton" Property="Visibility" Value="Collapsed" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>

                        <!-- Hide the filter description when there are no rules -->
                        <DataTrigger Binding="{Binding Path=FilterRulePanel.Controller.FilterRulePanelItems.Count, RelativeSource={RelativeSource Self}}" Value="0">
                            <Setter TargetName="PART_FilterDescription" Property="Visibility" Value="Collapsed" />
                        </DataTrigger>

                        <!-- Hide the Start and Stop buttons for "live" mode -->
                        <DataTrigger Binding="{Binding Evaluator.StartFilterOnExpressionChanged, RelativeSource={RelativeSource Self}}" Value="True">
                            <Setter TargetName="PART_StartFilterButton" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PART_StopFilterButton" Property="Visibility" Value="Collapsed" />
                        </DataTrigger>

                        <!-- In "non-live" mode, hide the Start button and show the Stop button when it's enabled -->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=IsEnabled, ElementName=PART_StopFilterButton}" Value="True" />
                                <Condition Binding="{Binding Evaluator.StartFilterOnExpressionChanged, RelativeSource={RelativeSource Self}}" Value="False" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter TargetName="PART_StartFilterButton" Property="Visibility" Value="Collapsed" />
                                <Setter TargetName="PART_StopFilterButton" Property="Visibility" Value="Visible" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>

                        <!-- Hide the search buttons when the search and filter aren't shown. -->
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSearchShown" Value="False" />
                                <Condition Property="IsFilterShown" Value="False" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter TargetName="PART_SearchButtonsContainer" Property="Visibility" Value="Collapsed" />
                            </MultiTrigger.Setters>
                        </MultiTrigger>

                        <Trigger Property="IsSearchShown" Value="False">
                            <Setter TargetName="PART_SearchBox" Property="Visibility" Value="Collapsed" />
                        </Trigger>

                        <!-- Toggle the state of the View Saver -->
                        <Trigger Property="ViewSaverUserActionState" Value="Hidden">
                            <Setter TargetName="PART_ViewSaver" Property="Visibility" Value="Collapsed" />
                        </Trigger>

                        <Trigger Property="ViewSaverUserActionState" Value="Disabled">
                            <Setter TargetName="PART_ViewSaver" Property="IsEnabled" Value="False" />
                        </Trigger>

                        <!-- Toggle the state of the View Manager -->
                        <Trigger Property="ViewManagerUserActionState" Value="Hidden">
                            <Setter TargetName="PART_ViewManager" Property="Visibility" Value="Collapsed" />
                        </Trigger>

                        <Trigger Property="ViewManagerUserActionState" Value="Disabled">
                            <Setter TargetName="PART_ViewManager" Property="IsEnabled" Value="False" />
                        </Trigger>

                        <!-- Hide the filter panel and View Manager when filter isn't shown -->
                        <Trigger Property="IsFilterShown" Value="False">
                            <Setter TargetName="buttonShowFilterPanel" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PART_ViewManager" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="PART_ViewSaver" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="filterPanelRow" Property="Visibility" Value="Collapsed" />
                        </Trigger>

                        <DataTrigger Binding="{Binding Path=Evaluator.FilterStatus, RelativeSource={RelativeSource Self}}" Value="NotApplied">
                            <Setter TargetName="PART_FilterDescription" Property="Visibility" Value="Collapsed" />
                        </DataTrigger>

                        <DataTrigger Binding="{Binding Path=Evaluator.FilterStatus, RelativeSource={RelativeSource Self}}" Value="Applied">
                            <Setter Property="Background" Value="{StaticResource FilterBackgroundSearch}" TargetName="SearchBG"/>
                            <Setter Property="Background" Value="{StaticResource FilterBackgroundSearch}" TargetName="filterPanelRow"/>
                            <!-- Force the text to Black since the background will be light -->
                            <Setter TargetName="buttonShowFilterPanel" Property="Foreground" Value="Black" />
                            <Setter TargetName="PART_FilterPanelScroller" Property="Foreground" Value="Black" />
                            <Setter TargetName="PART_FilterDescription" Property="Foreground" Value="Black" />
                        </DataTrigger>

                        <!-- Hide the list if there are no columns -->
                        <DataTrigger Binding="{Binding Path=List.Columns.Count, RelativeSource={RelativeSource Self}}" Value="0">
                            <Setter TargetName="PART_InnerList" Property="Visibility" Value="Hidden" />
                        </DataTrigger>

                        <!-- Show the progress indicator if the list is shown, filtering is in progress,
                             and no items have been retrieved -->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition
                                    Binding="{Binding Path=List.Visibility, RelativeSource={RelativeSource Self}}"
                                    Value="Visible" />
                                <Condition
                                    Binding="{Binding Path=Evaluator.FilterStatus, RelativeSource={RelativeSource Self}}"
                                    Value="InProgress" />
                                <Condition
                                    Binding="{Binding Path=List.Items.Count, RelativeSource={RelativeSource Self}}"
                                    Value="0" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter TargetName="PART_ProgressIndicator" Property="Visibility" Value="Visible" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>

                        <!-- Show the progress indicator if the list is loading items -->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=List.Visibility, RelativeSource={RelativeSource Self}}" Value="Visible" />
                                <Condition Binding="{Binding Path=IsLoadingItems, RelativeSource={RelativeSource Self}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter TargetName="PART_ProgressIndicator" Property="Visibility" Value="Visible" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>

                        <!--Show the "No Matches Found" Message when the Filter is applied and there are no items-->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition
                                    Binding="{Binding Path=List.Items.Count, RelativeSource={RelativeSource Self}}"
                                    Value="0" />
                                <Condition
                                    Binding="{Binding Path=Evaluator.FilterStatus, RelativeSource={RelativeSource Self}}"
                                    Value="Applied" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter
                                    TargetName="PART_NoMatchesFoundMessage"
                                    Property="Visibility"
                                    Value="Visible" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>

                        <!-- Assume items are loading if there is no data -->
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=List.ItemsSource, RelativeSource={RelativeSource Self}}" Value="{x:Null}" />
                                <Condition Binding="{Binding Path=List.Items.Count, RelativeSource={RelativeSource Self}}" Value="0" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.Setters>
                                <Setter Property="IsLoadingItems" Value="True" />
                            </MultiDataTrigger.Setters>
                        </MultiDataTrigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            Management List Title Xaml
        ==================================================================-->

    <Style x:Key="ManagementListTitle_Title_Style" TargetType="{x:Type local:AutomationTextBlock}" BasedOn="{StaticResource TextTrimmedTextBlockStyle}">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontSize" Value="16" />
        <Setter Property="ToolTipService.Placement" Value="Mouse" />
        <Setter Property="Margin" Value="8,4,0,4" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    </Style>

    <Style x:Key="ManagementListTitle_ListStatus_Style" TargetType="{x:Type local:AutomationTextBlock}">
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Padding" Value="8,5,5,2" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    </Style>

    <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:ManagementListTitle}, ResourceId=ManagementListTitle_Template}" TargetType="{x:Type local:ManagementListTitle}">
        <Border
                Background="{TemplateBinding Background}"
                Padding="{TemplateBinding Padding}">
            <Grid
                HorizontalAlignment="Left">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid>
                    <local:AutomationTextBlock
                        x:Name="PART_TitleShadow"
                        ToolTipService.IsEnabled="False"
                        IsHitTestVisible="False"
                        Margin="9,6,0,4"
                        Opacity="0.2"
                        Style="{StaticResource ManagementListTitle_Title_Style}"
                        Text="{Binding Path=Text, ElementName=PART_Title}" />

                    <local:AutomationTextBlock
                        x:Name="PART_Title"
                        AutomationProperties.AutomationId="Title"
                        Style="{StaticResource ManagementListTitle_Title_Style}"
                        Text="{TemplateBinding Title}" />

                </Grid>

                <local:AutomationTextBlock
                    Grid.Column="1"
                    x:Name="PART_ListStatus"
                    AutomationProperties.AutomationId="ListStatus"
                    Style="{StaticResource ManagementListTitle_ListStatus_Style}"
                    Text="{TemplateBinding ListStatus}" />
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=List.Evaluator.FilterStatus, RelativeSource={RelativeSource Self}}" Value="NotApplied">
                <Setter Property="ListStatus" Value="{Binding Path=TotalItemCount, RelativeSource={RelativeSource Self}, StringFormat={x:Static default:XamlLocalizableResources.ManagementListTitle_ListStatus_FilterNotApplied}}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=List.Evaluator.FilterStatus, RelativeSource={RelativeSource Self}}" Value="InProgress">
                <Setter Property="ListStatus" Value="{x:Static default:XamlLocalizableResources.ManagementListTitle_ListStatus_FilterInProgress}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=List.Evaluator.FilterStatus, RelativeSource={RelativeSource Self}}" Value="Applied">
                <Setter Property="ListStatus">
                    <Setter.Value>
                        <MultiBinding StringFormat="{x:Static default:XamlLocalizableResources.ManagementListTitle_ListStatus_FilterApplied}">
                            <Binding Path="List.List.Items.Count" RelativeSource="{RelativeSource Self}" />
                            <Binding Path="TotalItemCount" RelativeSource="{RelativeSource Self}" />
                        </MultiBinding>
                    </Setter.Value>
                </Setter>
                <Setter Property="Background" Value="{StaticResource FilterBackgroundSearch}" />
                <!-- Force the text to Black since the background will be light -->
                <Setter TargetName="PART_Title" Property="Foreground" Value="Black" />
                <Setter TargetName="PART_TitleShadow" Property="Foreground" Value="Black" />
                <Setter TargetName="PART_ListStatus" Property="Foreground" Value="Black" />
            </DataTrigger>

            <!--Show Title With View Name-->
            <DataTrigger
                Binding="{Binding Path=List.CurrentView, Converter={StaticResource IsNotNullConverter}, RelativeSource={RelativeSource Self}}"
                Value="True">
                <Setter
                    TargetName="PART_Title"
                    Property="Text">
                    <Setter.Value>
                        <MultiBinding
                            StringFormat="{x:Static default:XamlLocalizableResources.ManagementListTitle_Title_WithViewName}">
                            <Binding
                                Path="Title"
                                RelativeSource="{RelativeSource TemplatedParent}" />
                            <Binding
                                Path="List.CurrentView.Name"
                                RelativeSource="{RelativeSource TemplatedParent}" />
                        </MultiBinding>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type local:ManagementListTitle}">
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
        <Setter Property="Padding" Value="1" />
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
        <Setter Property="AutomationProperties.AutomationId" Value="ManagementListTitle"/>
        <Setter Property="Control.Template">
            <Setter.Value>
                <DynamicResource ResourceKey="{ComponentResourceKey ResourceId=ManagementListTitle_Template, TypeInTargetAssembly=local:ManagementListTitle}" />
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            Message Text Box Xaml
        ==================================================================-->

    <Style x:Key="{x:Type local:MessageTextBox}" TargetType="{x:Type local:MessageTextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="Margin" Value="1"/>
        <Setter Property="MaxLines" Value="1"/>
        <Setter Property="AutomationProperties.HelpText" Value="{Binding Path=BackgroundText, RelativeSource={RelativeSource Self}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:MessageTextBox}">
                    <classictheme:ClassicBorderDecorator Name="border"
                                                      BorderStyle="Sunken"
                            Background="{TemplateBinding Background}"
                                                      BorderThickness="{TemplateBinding BorderThickness}"
                                                      BorderBrush="{TemplateBinding BorderBrush}"
                                                      SnapsToDevicePixels="true">
                        <Grid >
                            <!-- Don't take out this part name. TextBox needs it to draw correctly. -->
                            <ScrollViewer Name="PART_ContentHost">
                                <ScrollViewer.Background>
                                    <VisualBrush
                                                 AlignmentX="Left"
                                                 AlignmentY="Top"
                                                 Stretch="None">
                                        <VisualBrush.Visual>
                                            <DockPanel Background="#00FFFFFF"
                                                       Width="{Binding ActualWidth, ElementName=PART_ContentHost}"
                                                       Height="{Binding ActualHeight, ElementName=PART_ContentHost}">
                                                <TextBlock x:Name="backgroundTextBlock"
                                                       Margin="3,0,0,0"
                                                       Text="{TemplateBinding BackgroundText}"
                                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                       FontStyle="Italic"
                                                       Foreground="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"
                                                       TextTrimming="CharacterEllipsis" />
                                            </DockPanel>
                                        </VisualBrush.Visual>
                                    </VisualBrush>
                                </ScrollViewer.Background>
                            </ScrollViewer>
                        </Grid>
                    </classictheme:ClassicBorderDecorator>
                    <ControlTemplate.Triggers>
                        <MultiTrigger >
                            <MultiTrigger.Conditions>
                                <Condition Property="IsBackgroundTextShown" Value="True"/>
                                <Condition Property="IsFocused" Value="True"/>
                                <Condition Property="IsReadOnly" Value="False"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="backgroundTextBlock" Property="Opacity" Value="0.65"/>
                        </MultiTrigger>

                        <Trigger Property="IsBackgroundTextShown" Value="False">
                            <Setter TargetName="backgroundTextBlock" Property="Opacity" Value="0"/>
                        </Trigger>


                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>


                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            PickerBase Style
        ==================================================================-->
    <Style TargetType="local:PickerBase">
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PickerBase">

                    <Grid x:Name="container"
                          HorizontalAlignment="Stretch">

                        <local:PopupControlButton x:Name="PART_DropDownButton"
                                                  AutomationProperties.Name="{Binding Path=(AutomationProperties.Name), RelativeSource={RelativeSource TemplatedParent}}"
                                                  AutomationProperties.AutomationId="{Binding Path=(AutomationProperties.AutomationId), RelativeSource={RelativeSource TemplatedParent}}"
                                                  Foreground="{TemplateBinding Foreground}"
                                                  IsPopupOpen="{Binding Path=IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                            <ContentPresenter Content="{TemplateBinding Header}"
                                              ContentTemplate="{TemplateBinding HeaderTemplate}"
                                              Margin="{TemplateBinding Control.Padding}" />
                        </local:PopupControlButton>

                        <local:DismissiblePopup x:Name="PART_DropDown"
                                                Style="{TemplateBinding DropDownStyle}"
                                                PlacementTarget="{Binding ElementName=PART_DropDownButton}"
                                                Placement="Bottom"
                                                PopupAnimation="Fade"
                                                AllowsTransparency="True"
                                                Focusable="True"
                                                IsOpen="{Binding Path=IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                                StaysOpen="False">

                            <ContentPresenter Margin="{TemplateBinding Control.Padding}" />
                        </local:DismissiblePopup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            SearchBox Xaml
        ==================================================================-->

    <Style x:Key="SearchBox_ClearButton_Style" TargetType="{x:Type ButtonBase}">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <local:ScalableImage>
                        <local:ScalableImage.Source>
                            <local:ScalableImageSource
                            AccessibleName="{Binding Path=ToolTip, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
                            Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/Delete16.png"
                            Size="10,10" />
                        </local:ScalableImage.Source>
                    </local:ScalableImage>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual_Style}" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard>
                        <Storyboard>
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0.4"/>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Storyboard>
                    </BeginStoryboard>
                </Trigger.ExitActions>
            </Trigger>
        </Style.Triggers>
    </Style>

    <ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type local:SearchBox}, ResourceId=SearchBox_Template}" TargetType="{x:Type local:SearchBox}">
        <Grid
            Background="{TemplateBinding Background}"
            Margin="{TemplateBinding Margin}">
            <local:MessageTextBox
                x:Name="PART_SearchBox"
                AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_SearchBox_AutomationPropertiesName_75}"
                BackgroundText="{TemplateBinding BackgroundText}"
                Padding="0, 0, 20, 0"
                Text="{Binding Path=Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TextTrimConverter}}">
                <local:MessageTextBox.InputBindings>
                    <KeyBinding Command="local:SearchBox.ClearTextCommand" Key="Escape" />
                </local:MessageTextBox.InputBindings>
            </local:MessageTextBox>
            <local:ScalableImage
                x:Name="PART_SearchImage"
                Margin="0,0,5,0"
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                Visibility="Hidden">
                <local:ScalableImage.Source>
                    <local:ScalableImageSource
                            AccessibleName="{Binding Path=ToolTip, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}}"
                            Image="pack://application:,,,/Microsoft.Powershell.GraphicalHost;component/resources/Graphics/SpyGlass10.png"
                            Size="12,12" />
                </local:ScalableImage.Source>
            </local:ScalableImage>
            <local:AutomationButton
                HorizontalAlignment="Right"
                VerticalAlignment="Center"
                AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_SearchBox_AutomationPropertiesName_85}"
                x:Name="PART_ClearSearchButton"
                Command="{x:Static local:SearchBox.ClearTextCommand}"
                Style="{StaticResource SearchBox_ClearButton_Style}"
                Margin="0,0,5,0" />
        </Grid>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=IsEnabled, ElementName=PART_ClearSearchButton}" Value="False">
                <Setter TargetName="PART_SearchImage" Property="Visibility" Value="Visible" />
                <Setter TargetName="PART_ClearSearchButton" Property="Visibility" Value="Hidden" />
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type local:SearchBox}">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Control.Template">
            <Setter.Value>
                <DynamicResource ResourceKey="{ComponentResourceKey ResourceId=SearchBox_Template, TypeInTargetAssembly=local:SearchBox}" />
            </Setter.Value>
        </Setter>
    </Style>


    <!--=================================================================
            Waiting Ring Xaml
        ==================================================================-->

    <Pen x:Key="RingBackground" Thickness="30">
        <Pen.Brush>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <LinearGradientBrush.GradientStops>
                    <GradientStop Color="#FFDAF2FE" Offset="0" />
                    <GradientStop Color="#FF75A1A0" Offset="0.4" />
                    <GradientStop Color="#FF296259" Offset="0.5" />
                    <GradientStop Color="#FF4EA295" Offset="0.6" />
                    <GradientStop Color="#FF4DAFA0" Offset="1" />
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
        </Pen.Brush>
    </Pen>

    <Pen x:Key="RingHighlight" Thickness="28">
        <Pen.Brush>
            <RadialGradientBrush Center="0.5,0.7" RadiusX="0.4" RadiusY="0.25">
                <RadialGradientBrush.GradientStops>
                    <GradientStop Color="#FF8DFCEB" Offset="0" />
                    <GradientStop Color="#FF8DFCEB" Offset="0.55" />
                    <GradientStop Color="#008DFCEB" Offset="1" />
                </RadialGradientBrush.GradientStops>
            </RadialGradientBrush>
        </Pen.Brush>
    </Pen>

    <Pen x:Key="RingBorder" Thickness="5">
        <Pen.Brush>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                <LinearGradientBrush.GradientStops>
                    <GradientStop Color="#FF94ACB8" Offset="0" />
                    <GradientStop Color="#FF75A1A0" Offset="0.4" />
                    <GradientStop Color="#FF296259" Offset="0.5" />
                    <GradientStop Color="#FF4EA295" Offset="0.6" />
                    <GradientStop Color="#FF2D8D81" Offset="1" />
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
        </Pen.Brush>
    </Pen>

    <Pen x:Key="StarLight" Thickness="15">
        <Pen.Brush>
            <RadialGradientBrush Center="1,0.45" RadiusX="0.7" RadiusY="0.5">
                <RadialGradientBrush.GradientStops>
                    <GradientStop Color="#FFFFFFFF" Offset="0" />
                    <GradientStop Color="#FF8DFCEB" Offset="0.4" />
                    <GradientStop Color="#AA8DFCEB" Offset="0.5" />
                    <GradientStop Color="#008DFCEB" Offset="1" />
                </RadialGradientBrush.GradientStops>
            </RadialGradientBrush>
        </Pen.Brush>
    </Pen>

    <Style TargetType="{x:Type local:WaitRing}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:WaitRing}">
                    <Image DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" x:Name="TemplateRoot"
                           AutomationProperties.AutomationId="IndeterminateProgressIcon"
                           AutomationProperties.Name="{x:Static default:XamlLocalizableResources.AutoResXGen_WaitingRing_AutomationPropertiesName_74}">
                        <Image.Source>
                            <DrawingImage >
                                <DrawingImage.Drawing>
                                    <DrawingGroup >
                                        <GeometryDrawing Pen="{StaticResource RingBackground}">
                                            <GeometryDrawing.Geometry>
                                                <EllipseGeometry Center="60,60" RadiusX="45" RadiusY="45" />
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>
                                        <GeometryDrawing Pen="{StaticResource RingHighlight}">
                                            <GeometryDrawing.Geometry>
                                                <EllipseGeometry Center="60,60" RadiusX="44" RadiusY="44" />
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>
                                        <GeometryDrawing Pen="{StaticResource RingBorder}">
                                            <GeometryDrawing.Geometry>
                                                <EllipseGeometry Center="60,60" RadiusX="32.5" RadiusY="32.5" />
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>
                                        <GeometryDrawing Pen="{StaticResource RingBorder}">
                                            <GeometryDrawing.Geometry>
                                                <EllipseGeometry Center="60,60" RadiusX="57.5" RadiusY="57.5" />
                                            </GeometryDrawing.Geometry>
                                        </GeometryDrawing>

                                        <DrawingGroup x:Name="StarLightDrawing">
                                            <GeometryDrawing Pen="{StaticResource StarLight}">
                                                <GeometryDrawing.Geometry>
                                                    <PathGeometry Figures="M 15,60 A 45,45,0,1,1,105,60" />
                                                </GeometryDrawing.Geometry>
                                            </GeometryDrawing>
                                            <DrawingGroup.Transform>
                                                <RotateTransform Angle="0" CenterX="60" CenterY="60" />
                                            </DrawingGroup.Transform>
                                        </DrawingGroup>
                                    </DrawingGroup>
                                </DrawingImage.Drawing>
                            </DrawingImage>
                        </Image.Source>
                        <Image.Triggers>
                            <EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="TemplateRoot">
                                <EventTrigger.Actions>
                                    <BeginStoryboard >
                                        <Storyboard Timeline.DesiredFrameRate="15">
                                            <DoubleAnimation From="0" To="360" RepeatBehavior="Forever"
                                                                 Duration="0:0:1"
                                                                 Storyboard.TargetName="StarLightDrawing"
                                                                 Storyboard.TargetProperty="(DrawingGroup.Transform).(RotateTransform.Angle)"/>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </EventTrigger.Actions>
                            </EventTrigger>
                        </Image.Triggers>
                    </Image>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>