<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:c1input="clr-namespace:C1.WPF.Input"
                    xmlns:c1Input_Resources="clr-namespace:C1.Silverlight.Input.Resources"
                    xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
        <ResourceDictionary Source="/C1.WPF.4;component/themes/C1Button.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <c1Input_Resources:C1_Silverlight_Input x:Key="InputResources"/>
    
    <c1input:CaptionEnableConverter x:Key="CaptionEnableConverter"/>
    <c1input:InverseBooleanConverter x:Key="InverseBooleanConverter"/>

    <Style x:Key="SymbolText" TargetType="TextBlock">
        <Setter Property="FontSize" Value="7"/>
        <Setter Property="FontFamily" Value="Segoe UI Symbol"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
    </Style>
    
    <Style x:Key="CheckBoxStyle" TargetType="CheckBox">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ShowCheckBoxState">
                                <VisualState x:Name="Show">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkLayout" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Hide">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkLayout" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Border x:Name="MarkLayout" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Grid>
                                <Path x:Name="MarkPath" Data="F1M9.97498,1.22334L4.6983,9.09834 4.52164,9.09834 0,5.19331 1.27664,3.52165 4.255,6.08833 8.33331,1.52588E-05 9.97498,1.22334z" Fill="#FF212121" Margin="1" Opacity="0" Stretch="None"/>
                                <Rectangle x:Name="MarkIndeterminate" Fill="#FF212121" Margin="2" Opacity="0"/>
                            </Grid>
                        </Border>
                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="True">
                            <Setter Property="FocusVisualStyle">
                                <Setter.Value>
                                    <Style>
                                        <Setter Property="Control.Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Padding" Value="4,-1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" TargetName="MarkLayout" Value="#FFF3F9FF"/>
                            <Setter Property="BorderBrush" TargetName="MarkLayout" Value="#FF5593FF"/>
                            <Setter Property="Fill" TargetName="MarkPath" Value="#FF212121"/>
                            <Setter Property="Fill" TargetName="MarkIndeterminate" Value="#FF212121"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" TargetName="MarkLayout" Value="#FFE6E6E6"/>
                            <Setter Property="BorderBrush" TargetName="MarkLayout" Value="#FFBCBCBC"/>
                            <Setter Property="Fill" TargetName="MarkPath" Value="#FF707070"/>
                            <Setter Property="Fill" TargetName="MarkIndeterminate" Value="#FF707070"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background" TargetName="MarkLayout" Value="#FFD9ECFF"/>
                            <Setter Property="BorderBrush" TargetName="MarkLayout" Value="#FF3C77DD"/>
                            <Setter Property="Fill" TargetName="MarkPath" Value="#FF212121"/>
                            <Setter Property="Fill" TargetName="MarkIndeterminate" Value="#FF212121"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Opacity" TargetName="MarkPath" Value="1"/>
                            <Setter Property="Opacity" TargetName="MarkIndeterminate" Value="0"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter Property="Opacity" TargetName="MarkPath" Value="0"/>
                            <Setter Property="Opacity" TargetName="MarkIndeterminate" Value="1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DefaultCaptionStyle" TargetType="CheckBox">
        <Setter Property="Background" Value="{StaticResource WpfInputSelectedBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource WpfInputSelectedForegroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Border x:Name="MarkLayout" Background="White" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Grid>
                                <Path x:Name="MarkPath" Data="F1M9.97498,1.22334L4.6983,9.09834 4.52164,9.09834 0,5.19331 1.27664,3.52165 4.255,6.08833 8.33331,1.52588E-05 9.97498,1.22334z" Fill="#FF212121" Margin="1" Opacity="0" Stretch="None"/>
                                <Rectangle x:Name="MarkIndeterminate" Fill="#FF212121" Margin="2" Opacity="0"/>
                            </Grid>
                        </Border>
                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>                        
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent" Value="True">
                            <Setter Property="FocusVisualStyle">
                                <Setter.Value>
                                    <Style>
                                        <Setter Property="Control.Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Padding" Value="4,-1,0,0"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" TargetName="MarkLayout" Value="#FFF3F9FF"/>
                            <Setter Property="BorderBrush" TargetName="MarkLayout" Value="#FF5593FF"/>
                            <Setter Property="Fill" TargetName="MarkPath" Value="#FF212121"/>
                            <Setter Property="Fill" TargetName="MarkIndeterminate" Value="#FF212121"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Background" TargetName="MarkLayout" Value="#FFE6E6E6"/>
                            <Setter Property="BorderBrush" TargetName="MarkLayout" Value="#FFBCBCBC"/>
                            <Setter Property="Fill" TargetName="MarkPath" Value="#FF707070"/>
                            <Setter Property="Fill" TargetName="MarkIndeterminate" Value="#FF707070"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Background" TargetName="MarkLayout" Value="#FFD9ECFF"/>
                            <Setter Property="BorderBrush" TargetName="MarkLayout" Value="#FF3C77DD"/>
                            <Setter Property="Fill" TargetName="MarkPath" Value="#FF212121"/>
                            <Setter Property="Fill" TargetName="MarkIndeterminate" Value="#FF212121"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Opacity" TargetName="MarkPath" Value="1"/>
                            <Setter Property="Opacity" TargetName="MarkIndeterminate" Value="0"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="{x:Null}">
                            <Setter Property="Opacity" TargetName="MarkPath" Value="0"/>
                            <Setter Property="Opacity" TargetName="MarkIndeterminate" Value="1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!-- Style C1CheckList -->
    <Style TargetType="c1input:C1CheckList">
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />        
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
        <Setter Property="MouseOverBrush" Value="{StaticResource MouseOverBrush}"/>
        <Setter Property="SelectedBackground" Value="{StaticResource SelectedBackground}"/>
        <Setter Property="ShowCheckBoxes" Value="True"/>
        <Setter Property="SelectAllCaption" Value="{Binding Source={StaticResource InputResources},Path=CheckList_SelectAllCaption}"/>
        <Setter Property="UnSelectAllCaption" Value="{Binding Source={StaticResource InputResources},Path=CheckList_UnSelectAllCaption}"/>
        <Setter Property="ShowSelectAll" Value="False"/>
        <Setter Property="CaptionStyle" Value="{StaticResource DefaultCaptionStyle}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />        
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <c1:C1ListViewerPanel />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1input:C1CheckList">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="1">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ShowCaptionState">
                                <VisualState x:Name="ShowCaption">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Caption" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="HideCaption">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Caption" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <CheckBox x:Name="Caption" Content="{TemplateBinding SelectAllCaption}" IsEnabled="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=SelectionMode,Converter={StaticResource CaptionEnableConverter}}" Style="{TemplateBinding CaptionStyle}"/>
                            <ScrollViewer x:Name="ScrollViewer" Focusable="False" Padding="{TemplateBinding Padding}" Grid.Row="1">
                                <ItemsPresenter />
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1MultiSelect -->
    <Style TargetType="c1input:C1MultiSelect">
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="Foreground" Value="{StaticResource ForegroundTextBoxBrushColor}" />
        <Setter Property="MouseOverBrush" Value="{StaticResource MouseOverBrush}"/>
        <Setter Property="SelectedBackground" Value="{StaticResource SelectedBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
        <Setter Property="SelectAllCaption" Value="{Binding Source={StaticResource InputResources},Path=CheckList_SelectAllCaption}"/>
        <Setter Property="UnSelectAllCaption" Value="{Binding Source={StaticResource InputResources},Path=CheckList_UnSelectAllCaption}"/>
        <Setter Property="ShowCheckBoxes" Value="True"/>
        <Setter Property="ShowSelectAll" Value="False"/>
        <Setter Property="CaptionStyle" Value="{StaticResource DefaultCaptionStyle}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1input:C1MultiSelect">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="HeaderFormatStates">
                                <VisualState x:Name="ShowHeaderFormat">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="HeaderFormat" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="Editor" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="HideHeaderFormat">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Editor" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1DropDown x:Name="DropDown" IsDropDownOpen="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsDroppedDown,Mode=TwoWay}" 
                                   BorderBrush="{TemplateBinding BorderBrush}"
                                   DropDownWidth="{TemplateBinding DropdownWidth}"
                                   DropDownHeight="{TemplateBinding DropdownHeight}"    
                                   MaxDropDownHeight="{TemplateBinding MaxDropDownHeight}" 
                                   MaxDropDownWidth="{TemplateBinding MaxDropDownWidth}"    
                                   BorderThickness="{TemplateBinding BorderThickness}" 
                                   Background="{TemplateBinding Background}" 
                                   MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                   PressedBrush="{TemplateBinding PressedBrush}" 
                                   IsEnabled="{TemplateBinding IsEnabled}" 
                                   AutoClose="True" DisabledCuesVisibility="Visible" AutoSizeMode="GrowAndShrink" Padding="0" HeaderPadding="0" ShowButton="{TemplateBinding ShowDropDownButton}">
                            <c1:C1DropDown.Header>
                                <Grid>
                                    <c1input:C1TagEditor x:Name="Editor" BorderThickness="0" PlaceHolder="{TemplateBinding PlaceHolder}"
                                                         HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                         VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"  
                                                         IsTagEditable="{TemplateBinding IsTagEditable}" DisplayMode="{TemplateBinding DisplayMode}" 
                                                         Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" 
                                                         Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}" 
                                                         Separator="{TemplateBinding Separator}" IsEditable="{TemplateBinding IsEditable}" 
                                                         TagStyle="{TemplateBinding TagStyle}"/>
                                    <ContentControl x:Name="HeaderFormat" IsTabStop="False" IsHitTestVisible="False" 
                                                    Foreground="{TemplateBinding Foreground}" Background="{TemplateBinding Background}"
                                                    Margin="{TemplateBinding Padding}" 
                                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                    Opacity="0.65" Visibility="Collapsed" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" />
                                </Grid>
                            </c1:C1DropDown.Header>
                            <Grid>
                                <c1input:C1CheckList x:Name="CheckList"
                                             HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                             VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"        
                                             ShowSelectAll="{TemplateBinding ShowSelectAll}"
                                             SelectAllCaption="{TemplateBinding SelectAllCaption}"
                                             UnSelectAllCaption="{TemplateBinding UnSelectAllCaption}"
                                             CaptionStyle="{TemplateBinding CaptionStyle}"
                                             SelectedBackground="{TemplateBinding SelectedBackground}" 
                                             MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                             DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
                                             ShowCheckBoxes="{TemplateBinding ShowCheckBoxes}" 
                                             ItemsSource="{TemplateBinding ItemsSource}"
                                             CheckedMemberPath="{TemplateBinding CheckedMemberPath}"
                                             DisabledMemberPath="{TemplateBinding DisabledMemberPath}"
                                             SelectedItem="{Binding SelectedItem, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
                                             SelectedItems="{Binding SelectedItems, RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}"
                                             ItemTemplate="{TemplateBinding ItemTemplate}"
                                             ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                             IsTextSearchCaseSensitive="{TemplateBinding IsTextSearchCaseSensitive}"
                                             ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
                                             />
                                <c1:C1ListBox x:Name="FilterList" Visibility="Collapsed" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                             VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" SelectionMode="Single" 
                                             MouseOverBrush="{TemplateBinding MouseOverBrush}" DisplayMemberPath="{TemplateBinding DisplayMemberPath}" 
                                             ItemStringFormat="{TemplateBinding ItemStringFormat}"/>
                            </Grid>
                        </c1:C1DropDown>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Style C1CheckListItem-->
    <Style TargetType="c1input:C1CheckListItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1input:C1CheckListItem">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="NotSelected">
                                    <Storyboard/>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedBackgroundElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>                            
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                            <Grid x:Name="Hinting">
                                <Rectangle x:Name="SelectedBackgroundElement" Fill="{TemplateBinding SelectedBackground}" Opacity="0" />
                                <Rectangle x:Name="MouseOverElement" Fill="{TemplateBinding MouseOverBrush}" Opacity="0" />
                                <CheckBox x:Name="Content"  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="False" IsChecked="{TemplateBinding IsSelected}" Style="{StaticResource CheckBoxStyle}" Foreground="{TemplateBinding Foreground}">
                                    <ContentPresenter/>
                                </CheckBox>
                                <Grid x:Name="HintingCheckMark" Visibility="Collapsed"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1TagEditor -->
    <Style TargetType="c1input:C1TagEditor">
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="Padding" Value="2,0,0,0" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Cursor" Value="IBeam" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1input:C1TagEditor">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}">
                        <ScrollViewer x:Name="TagScrollViewer" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" Focusable="False">
                            <c1:C1WrapPanel x:Name="Container" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                                <c1:C1TextBoxBase x:Name="Editor" Background="{TemplateBinding Background}" FontFamily="{TemplateBinding FontFamily}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                                  FontSize="{TemplateBinding FontSize}" FontStyle="{TemplateBinding FontStyle}" FontStretch="{TemplateBinding FontStretch}" 
                                                  FontWeight="{TemplateBinding FontWeight}" BorderThickness="0" Foreground="{TemplateBinding Foreground}" 
                                                  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                  IsEnabled="{TemplateBinding IsEnabled}" Padding="0" TabIndex="{TemplateBinding TabIndex}" Watermark="{TemplateBinding PlaceHolder}" 
                                                  IsReadOnly="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=IsEditable,Converter={StaticResource InverseBooleanConverter}}"/>
                            </c1:C1WrapPanel>
                        </ScrollViewer>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1Tag -->
    <Style TargetType="c1input:C1Tag">
        <Setter Property="BorderBrush" Value="{StaticResource WpfInputBorderBrush}" />
        <Setter Property="BorderThickness" Value="{StaticResource GeneralThickness}" />
        <Setter Property="Background" Value="#ededed" />
        <Setter Property="Margin" Value="0,0,2,2" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1input:C1Tag">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <ContentPresenter x:Name="Content" VerticalAlignment="Center" Margin="2"></ContentPresenter>
                            <c1:C1TextBoxBase x:Name="Editor" VerticalAlignment="Stretch" BorderThickness="0" Text="{TemplateBinding Content}" Opacity="0" Padding="0" IsHitTestVisible="False" IsTabStop="False" Margin="0"></c1:C1TextBoxBase>
                            <Button x:Name="Remove" VerticalAlignment="Stretch" Margin="1,0,0,0" Cursor="Hand" Grid.Column="1" BorderThickness="0" Background="Transparent">
                                <TextBlock Text="&#xE106;" Style="{StaticResource SymbolText}" />
                            </Button>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>
