	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:c1="clr-namespace:C1.WPF">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1ScrollBar.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--******************* C1ComboBox ******************-->

    <!-- Brush @ ComboBoxItem Background on MouseOver -->
    <LinearGradientBrush x:Key="ComboBoxItemMouseOverBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFF1FBFF" Offset="0" />
        <GradientStop Color="#FFC5E3ED" Offset="1" />
    </LinearGradientBrush>

    <!-- Brush @ ComboBoxItem Selected Background -->
    <LinearGradientBrush x:Key="ComboBoxItemSelectedBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFDEF3FA" Offset="0" />
        <GradientStop Color="#FFA8D4E3" Offset="1" />
    </LinearGradientBrush>

    <!-- Brush @ ComboBoxItem Selected Border -->
    <CornerRadius x:Key="ComboBoxItemCornerRadius">2</CornerRadius>

    <!-- C1ComboBoxItem -->
    <Style TargetType="c1:C1ComboBoxItem">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        
        
        <Setter Property="VerticalContentAlignment">
            <Setter.Value>
                <Binding Path="VerticalContentAlignment" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ItemsControl, AncestorLevel=1}" />
            </Setter.Value>
        </Setter>
        <Setter Property="HorizontalContentAlignment">
            <Setter.Value>
                <Binding Path="HorizontalContentAlignment" RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ItemsControl, AncestorLevel=1}" />
            </Setter.Value>
        </Setter>
        <Setter Property="Padding" Value="3 2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1ComboBoxItem">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="SelectedElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FilterCondition">
                                <VisualState x:Name="UnselectPrevious" />
                                <VisualState x:Name="SelectFirstOne">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FilterElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="SelectedBackground" Input="{TemplateBinding SelectedBackground}" DesignBrush="{StaticResource ComboBoxItemSelectedBackground}" DesignColor="{StaticResource SelectedColor}" />
                        <c1:C1BrushBuilder x:Name="MouseOverBrush" Input="{TemplateBinding MouseOverBrush}" DesignBrush="{StaticResource ComboBoxItemMouseOverBrush}" DesignColor="{StaticResource MouseOverColor}" />
                        <Border x:Name="BackgroundElement" Background="{TemplateBinding Background}" />
                        <Border x:Name="SelectedElement" IsHitTestVisible="False" Background="{Binding ElementName=SelectedBackground, Path=Output}" BorderBrush="{TemplateBinding SelectedBackground}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource ComboBoxItemCornerRadius}" Visibility="Collapsed" />
                        <Border x:Name="MouseOverElement" IsHitTestVisible="False" Background="{Binding ElementName=MouseOverBrush, Path=Output}" BorderBrush="{TemplateBinding MouseOverBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource ComboBoxItemCornerRadius}" Visibility="Collapsed" />
                        <Border x:Name="FilterElement" IsHitTestVisible="False" Background="{Binding ElementName=SelectedBackground, Path=Output}" BorderBrush="{TemplateBinding SelectedBackground}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{StaticResource ComboBoxItemCornerRadius}" Visibility="Collapsed" />
                        <Grid Margin="{TemplateBinding BorderThickness}">
                            <ContentPresenter x:Name="ContentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" />
                        </Grid>
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="{StaticResource GeneralCornerRadius}" IsHitTestVisible="False" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- C1ComboBox -->
    <Style TargetType="c1:C1ComboBox" x:Key="C1ComboBoxStyle">
        
        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />        
        <Setter Property="ButtonBackground" Value="{StaticResource WpfInputBaseBrush}" />
        <Setter Property="MouseOverBrush" Value="{StaticResource WpfInputMouseOverBrush}" />
        <Setter Property="FocusBrush" Value="{StaticResource WpfInputFocusBrush}" />
        <Setter Property="SelectedBackground" Value="{StaticResource WpfInputSelectedBackground}" />
        <Setter Property="PressedBrush" Value="{StaticResource WpfInputSelectedBackground}" />
        <Setter Property="SelectionBackground" Value="{StaticResource WpfInputSelectedForegroundBrush}" />
        <Setter Property="SelectionForeground" Value="{StaticResource WpfInputSelectedBackgroundBrush}" />
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="ButtonForeground" Value="{StaticResource ForegroundBrushColor}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="TextAlignment" Value="Left" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="Padding" Value="2" />
        <Setter Property="ScrollBarStyle" Value="{StaticResource ScrollBarClearStyle}" />
        <Setter Property="CornerRadius" Value="{StaticResource GeneralCornerRadius}" />
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <!--add by Jeffrey 2012.1.19 for issue 19195-->
        
        <Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <AdornedElementPlaceholder />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <!--end by Jeffrey-->
        <!--<Setter Property="ItemContainerStyle" Value="{StaticResource C1.Silverlight.C1ComboBoxItem}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1ComboBox">
                    <Grid x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:ValidationState>InvalidUnfocused</c1:ValidationState>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:ValidationState>InvalidFocused</c1:ValidationState>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder x:Name="InnerBorderBrush" Input="{TemplateBinding Background}" DesignBrush="{StaticResource InnerBorderBrush}" DesignColor="{StaticResource BaseColor}" />
                        <c1:C1DropDown x:Name="DropDown" DropDownDirection="{TemplateBinding DropDownDirection}" DropDownHeight="{TemplateBinding DropDownHeight}" DropDownWidth="{TemplateBinding DropDownWidth}" MaxDropDownHeight="{TemplateBinding MaxDropDownHeight}" MaxDropDownWidth="{TemplateBinding MaxDropDownWidth}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding ButtonBackground}" Foreground="{TemplateBinding ButtonForeground}" MouseOverBrush="{TemplateBinding MouseOverBrush}" FocusBrush="{TemplateBinding FocusBrush}" PressedBrush="{TemplateBinding PressedBrush}" IsEnabled="{TemplateBinding IsEnabled}" FocusCuesVisibility="{TemplateBinding FocusCuesVisibility}" CornerRadius="{TemplateBinding CornerRadius}" DisabledCuesVisibility="Visible" AutoSizeMode="GrowAndShrink" Padding="0" HeaderPadding="0">
                            <c1:C1DropDown.Header>
                                <Grid>
                                    <Border Background="{TemplateBinding Background}" CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter='topleft bottomleft'}" />
                                    
                                    
                                    <c1:C1TextEditableContentControl x:Name="ComboHeader" DisabledCuesVisibility="Collapsed" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" TextAlignment="{TemplateBinding TextAlignment}" FontWeight="{TemplateBinding FontWeight}" BorderThickness="0" Foreground="{TemplateBinding Foreground}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" SelectionBackground="{TemplateBinding SelectionBackground}" SelectionForeground="{TemplateBinding SelectionForeground}" IsEnabled="{TemplateBinding IsEnabled}" Padding="{TemplateBinding Padding}" TabIndex="{TemplateBinding TabIndex}" />
                                    <!--
                            //add comments by StarLi@20120719  for issue TFS-19124
                            //For fixing the the issue that Color is flickering in 'CaretBrush' Color Box after colour pattern changed and mouse cursor  placed  inside C1ComboBox.
                            //CaretBrush="{TemplateBinding CaretBrush}" 
                            -->
                                    <!--FocusCuesVisibility="Collapsed"-->
                                    <Rectangle x:Name="HeaderClickInterceptor" Fill="Transparent" />
                                </Grid>
                            </c1:C1DropDown.Header>
                            <c1:C1DropDown.Content>
                                <ScrollViewer x:Name="ScrollViewer" IsTabStop="False" Background="{Binding Path=Background,RelativeSource={RelativeSource TemplatedParent}}" Foreground="{Binding Path=Foreground,RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{Binding Path=BorderBrush,RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalScrollBarVisibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(ScrollViewer.HorizontalScrollBarVisibility)}" VerticalScrollBarVisibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(ScrollViewer.VerticalScrollBarVisibility)}" VerticalContentAlignment="{Binding Path=VerticalContentAlignment,RelativeSource={RelativeSource TemplatedParent}}" HorizontalContentAlignment="{Binding Path=HorizontalContentAlignment,RelativeSource={RelativeSource TemplatedParent}}" Padding="{Binding Path=Padding,RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ScrollViewerClearStyle}" c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" c1:ClearStyleExtensions.ScrollBarStyle="{Binding Path=ScrollBarStyle,RelativeSource={RelativeSource TemplatedParent}}">
                                    <ItemsPresenter />
                                    <c1:ScrollViewerTouchBehavior.TouchBehavior>
                                        <c1:ScrollViewerTouchBehavior />
                                    </c1:ScrollViewerTouchBehavior.TouchBehavior>
                                </ScrollViewer>
                            </c1:C1DropDown.Content>
                        </c1:C1DropDown>
                        <c1:C1ValidationDecorator x:Name="ValidationDecorator" Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" Style="{TemplateBinding ValidationDecoratorStyle}" CornerRadius="{TemplateBinding CornerRadius}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="c1:C1ComboBox" BasedOn="{StaticResource C1ComboBoxStyle}" />
</ResourceDictionary>
