<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c1input="using:C1.Xaml.Input"
    xmlns:c1="using:C1.Xaml"
    xmlns:c1Input_Resources="using:C1.Silverlight.Input.Resources">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/Common.xaml"/>
        <ResourceDictionary Source="ms-appx:///C1.UWP/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="CheckBoxStyle" TargetType="CheckBox">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid BorderBrush="{TemplateBinding Foreground}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CombinedStates">
                                <VisualState x:Name="UncheckedNormal" />
                                <VisualState x:Name="UncheckedPointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UncheckedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="StrokeThickness" To="{ThemeResource CheckBoxCheckedStrokeThickness}" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UncheckedDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedNormal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="StrokeThickness" To="{ThemeResource CheckBoxCheckedStrokeThickness}" Duration="0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="MarkGlyph" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="MarkGlyph" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="StrokeThickness" To="{ThemeResource CheckBoxCheckedStrokeThickness}" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="MarkGlyph" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkIndeterminate" Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MarkGlyph" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="MarkGlyph" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <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>
                        <Grid VerticalAlignment="Top" Height="32" x:Name="MarkLayout">
                            <Rectangle x:Name="MarkIndeterminate" Fill="Transparent" Stroke="{TemplateBinding Foreground}" StrokeThickness="{ThemeResource CheckBoxBorderThemeThickness}" UseLayoutRounding="False" Height="20" Width="20" />
                            <FontIcon x:Name="MarkGlyph" FontFamily="{ThemeResource SymbolThemeFontFamily}" Glyph="&#xE001;" FontSize="20" Foreground="{TemplateBinding Foreground}" Opacity="0" />
                        </Grid>
                        <ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Grid.Column="1" AutomationProperties.AccessibilityView="Raw" TextWrapping="Wrap" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="DefaultCaptionStyle" TargetType="CheckBox">
        <Setter Property="Background" Value="{ThemeResource SystemControlDisabledChromeDisabledHighBrush}"/>
        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
    </Style>
    
    <!-- Style C1CheckList -->
    <Style TargetType="c1input:C1CheckList">
        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}" />
        <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="BorderThickness" Value="{ThemeResource ListBoxBorderThemeThickness}" />
        <Setter Property="MouseOverBrush" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
        <Setter Property="SelectedBackground" Value="{ThemeResource SystemControlHighlightListAccentLowBrush}"/>
        <Setter Property="ShowCheckBoxes" Value="True"/>
        <Setter Property="ShowSelectAll" Value="False"/>
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Center" />        
        <Setter Property="CaptionStyle" Value="{StaticResource DefaultCaptionStyle}"/>
        <Setter Property="SelectAllCaption" Value="{Binding CheckList_SelectAllCaption, Source={StaticResource InputResources}}"/>
        <Setter Property="UnSelectAllCaption" Value="{Binding CheckList_UnSelectAllCaption, Source={StaticResource InputResources}}"/>
        <Setter Property="ZoomMode" Value="Disabled"/>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <DataTemplate>
                    <c1:C1ListViewerPanel Background="Transparent" />
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1input:C1CheckList">
                    <Border Padding="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <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" Margin="2,0,2,0" IsEnabled="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=SelectionMode,Converter={StaticResource CaptionEnableConverter}}" Content="{TemplateBinding SelectAllCaption}" Style="{TemplateBinding CaptionStyle}" />
                            <ScrollViewer x:Name="ScrollViewer" Padding="{TemplateBinding Padding}" Grid.Row="1">
                                <ItemsPresenter />
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1MultiSelect -->
    <Style TargetType="c1input:C1MultiSelect">
        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundAltMediumLowBrush}" />
        <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumLowBrush}" />
        <Setter Property="BorderThickness" Value="{ThemeResource ComboBoxBorderThemeThickness}" />
        <Setter Property="MouseOverBrush" Value="{ThemeResource SystemControlHighlightListLowBrush}"/>
        <Setter Property="SelectedBackground" Value="{ThemeResource SystemControlHighlightListAccentLowBrush}"/>
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />        
        <Setter Property="ShowCheckBoxes" Value="True"/>
        <Setter Property="ShowSelectAll" Value="False"/>
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="CaptionStyle" Value="{StaticResource DefaultCaptionStyle}"/>
        <Setter Property="SelectAllCaption" Value="{Binding CheckList_SelectAllCaption, Source={StaticResource InputResources}}"/>
        <Setter Property="UnSelectAllCaption" Value="{Binding CheckList_UnSelectAllCaption, Source={StaticResource InputResources}}"/>
        <Setter Property="PressedBrush" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
        <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 Mode=TemplatedParent},Path=IsDroppedDown,Mode=TwoWay}"
                                   MaxDropDownHeight="{TemplateBinding MaxDropDownHeight}" 
                                   MaxDropDownWidth="{TemplateBinding MaxDropDownWidth}" 
                                   DropDownWidth="{TemplateBinding DropdownWidth}"
                                   DropDownHeight="{TemplateBinding DropdownHeight}"    
                                   BorderBrush="{TemplateBinding BorderBrush}" 
                                   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>
                            <c1:C1DropDown.Content>
                                <Grid>
                                    <c1input:C1CheckList x:Name="CheckList" ShowCheckBoxes="{TemplateBinding ShowCheckBoxes}"
                                                 BorderBrush="{TemplateBinding BorderBrush}" 
                                                 BorderThickness="{TemplateBinding BorderThickness}"
                                                 Foreground="{TemplateBinding Foreground}"
                                                 ItemsSource="{TemplateBinding ItemsSource}"
                                                 DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
                                                 ShowSelectAll="{TemplateBinding ShowSelectAll}"
                                                 CaptionStyle="{TemplateBinding CaptionStyle}"
                                                 SelectAllCaption="{TemplateBinding SelectAllCaption}"
                                                 UnSelectAllCaption="{TemplateBinding UnSelectAllCaption}"
                                                 SelectedBackground="{TemplateBinding SelectedBackground}" 
                                                 MouseOverBrush="{TemplateBinding MouseOverBrush}"                                                                                                  
                                                 DisabledMemberPath="{TemplateBinding DisabledMemberPath}"
                                                 HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                                 VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"        
                                                 />
                                    <c1:C1ListBox x:Name="FilterList" Background="{Binding ElementName=CheckList,Path=Background}" Foreground="{TemplateBinding Foreground}" Visibility="Collapsed" 
                                                  HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  DisplayMemberPath="{TemplateBinding DisplayMemberPath}"/>
                                </Grid>
                            </c1:C1DropDown.Content>
                        </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>
                                        <DoubleAnimation Duration="0:0:0" From="1" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedBackgroundElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0" From="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedBackgroundElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>                            
                        </VisualStateManager.VisualStateGroups>
                        <Border Padding="2,0" 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" Foreground="{TemplateBinding Foreground}" IsHitTestVisible="False"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          IsChecked="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=IsSelected,Mode=TwoWay}" 
                                          Style="{StaticResource CheckBoxStyle}">
                                    <ContentPresenter/>
                                </CheckBox>
                                <Grid x:Name="HintingCheckMark" Visibility="Collapsed"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1TagEditor -->
    <Style TargetType="c1input:C1TagEditor">
        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="Background" Value="{ThemeResource SystemControlBackgroundAltHighBrush}" />
        <Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundChromeDisabledLowBrush}" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="Padding" Value="2,0,0,0" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1input:C1TagEditor">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
                        <ScrollViewer x:Name="TagScrollViewer" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled">
                            <c1:C1WrapPanel x:Name="Container" Orientation="Horizontal" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
                                <c1:C1TextBoxBase x:Name="Editor" Background="{TemplateBinding Background}" FontFamily="{TemplateBinding FontFamily}" 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}}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                            </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="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"/>
                            <Button x:Name="Remove" VerticalAlignment="Stretch" Margin="1,0,0,0" Grid.Column="1" BorderThickness="0" Background="Transparent">
                                <TextBlock x:Name="GlyphElement"
                                    Foreground="{ThemeResource SystemControlForegroundChromeBlackMediumBrush}"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    FontStyle="Normal"
                                    FontSize="12"
                                    Text="&#xE10A;"
                                    FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                    AutomationProperties.AccessibilityView="Raw"/>
                            </Button>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
