<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c1="using:C1.Xaml"
    xmlns:dt="using:C1.Xaml.DateTimeEditors"
    xmlns:c1InputPanel="using:C1.Xaml.InputPanel"
    xmlns:c1InputPanel_Resources="using:C1.Silverlight.InputPanel.Resources">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/C1Button.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <c1InputPanel_Resources:C1_Silverlight_InputPanel x:Key="Resources" />

    <Style x:Key="FooterBorder" TargetType="Border">
        <Setter Property="Background" Value="{ThemeResource ProgressBarBackgroundThemeBrush}" />
        <Setter Property="BorderThickness" Value="0 1 0 0" />
    </Style>

    <Style x:Key="IconEditor" TargetType="Path">
        <Setter Property="Stretch" Value="Fill" />
        <Setter Property="Width" Value="12"/>
        <Setter Property="Height" Value="14"/>
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
    </Style>

    <Style x:Key="NavigationPath" TargetType="Path">
        <Setter Property="Stretch" Value="Fill"/>
        <Setter Property="Width" Value="10"/>
        <Setter Property="Height" Value="14"/>
    </Style>

    <Style TargetType="ItemsControl" x:Key="ErrorStyle">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <ScrollViewer IsTabStop="False" BorderThickness="0 0 0 1" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto">
                        <ItemsPresenter MinWidth="1" MinHeight="1"/>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Foreground="{Binding ValidationHeaderForeground}" Margin="5 5 0 5" TextBlock.FontWeight="Bold" Text="{Binding ErrorInputName}" />
                        <TextBlock Foreground="{Binding ValidationHeaderForeground}" TextBlock.FontWeight="Bold" Text=":" Margin="0 5 0 0" />
                        <TextBlock Foreground="{Binding ValidationContentForeground}" Margin="5 5 0 5" Text="{Binding ErrorContent}" />
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="MaxHeight" Value="75" />
    </Style>

    <!-- Style C1InputPanelValidationSummary -->
    <Style TargetType="c1InputPanel:C1InputPanelValidationSummary">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputPanelValidationSummary">
                    <Border Background="{TemplateBinding Background}" >
                        <ItemsControl IsTabStop="False" Style="{StaticResource ErrorStyle}"
                                      ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Errors}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1InputPanel -->
    <Style TargetType="c1InputPanel:C1InputPanel">
        <Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}"/>
        <Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource ApplicationForegroundThemeBrush}" />
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HeaderBackground" Value="{ThemeResource ProgressBarBackgroundThemeBrush}" />
        <Setter Property="HeaderForeground" Value="{ThemeResource ApplicationHeaderForegroundThemeBrush}" />
        <Setter Property="NavigationBackground" Value="{ThemeResource ProgressBarBackgroundThemeBrush}" />
        <Setter Property="ValidationHeaderForeground" Value="#FFFF0000"/>
        <Setter Property="ValidationContentForeground" Value="{ThemeResource ApplicationForegroundThemeBrush}"/>
        <Setter Property="ValidationBackground" Value="{ThemeResource ProgressBarBackgroundThemeBrush}"/>
        <Setter Property="FooterBorderStyle" Value="{StaticResource FooterBorder}"/>
        <Setter Property="HeaderFontSize" Value="14" />
        <Setter Property="HeaderFontWeight" Value="Bold" />
        <Setter Property="LabelForeground" Value="{ThemeResource ApplicationForegroundThemeBrush}"/>
        <Setter Property="NavigationButtonStyle" Value="{StaticResource ClearStyleButtonStyle}"/>
        <Setter Property="MouseOverBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="PressedBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="FocusBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="ButtonBackground" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}"/>
        <Setter Property="ButtonForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="CornerRadius" Value="{ThemeResource GeneralCornerRadius}"/>
        <Setter Property="ItemsPanelTemplate">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Vertical" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="MinWidth" Value="350" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputPanel">
                    <Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled" />
                                <VisualState x:Name="MouseOver" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ReadOnlyState">
                                <VisualState x:Name="ActionButtonsHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Add" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Delete" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Commit" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Cancel" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ActionButtonsShown">
                                    <Storyboard/>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="NavigationVisibilityState">
                                <VisualState x:Name="NavigationHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Navigation" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="NavigationShown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Navigation" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="AddButtonVisibilityState">
                                <VisualState x:Name="AddButtonHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Add" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="AddButtonShown">
                                    <Storyboard>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DeleteButtonVisibilityState">
                                <VisualState x:Name="DeleteButtonHidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Delete" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DeleteButtonShown">
                                    <Storyboard>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="AddButtonEnableState">
                                <VisualState x:Name="AddButtonNormal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Add" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.001"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="AddButtonDisable">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Add" Storyboard.TargetProperty="Opacity" To="0.4" Duration="0:0:0.001"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DeleteButtonEnableState">
                                <VisualState x:Name="DeleteButtonNormal">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Delete" Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.001"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DeleteButtonDisable">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Delete" Storyboard.TargetProperty="Opacity" To="0.4" Duration="0:0:0.001"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="InputPanelGrid" Background="{TemplateBinding Background}">
                            <Grid.RowDefinitions>
                                <RowDefinition RowDefinition.Height="Auto" />
                                <RowDefinition RowDefinition.Height="Auto" />
                                <RowDefinition RowDefinition.Height="*" />
                                <RowDefinition RowDefinition.Height="Auto" />
                                <RowDefinition RowDefinition.Height="Auto" />
                            </Grid.RowDefinitions>
                            <!-- Header -->
                            <Border x:Name="Header" Background="{TemplateBinding HeaderBackground}" 
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Grid.Row="0" Padding="{TemplateBinding HeaderPadding}">
                                <ContentControl IsTabStop="False" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"
                                            Foreground="{TemplateBinding HeaderForeground}" 
                                            HorizontalContentAlignment="{TemplateBinding HorizontalHeaderAlignment}" 
                                            VerticalContentAlignment="{TemplateBinding VerticalHeaderAlignment}" 
                                            FontFamily="{TemplateBinding HeaderFontFamily}" FontSize="{TemplateBinding HeaderFontSize}" 
                                            FontStretch="{TemplateBinding HeaderFontStretch}" 
                                            FontStyle="{TemplateBinding HeaderFontStyle}" FontWeight="{TemplateBinding HeaderFontWeight}"/>
                            </Border>
                            <!-- Navigation -->
                            <Border x:Name="Navigation" Grid.Row="1" Background="{TemplateBinding NavigationBackground}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <c1InputPanel:C1DataPager x:Name="DataPager" Background="Transparent" Foreground="{TemplateBinding Foreground}" LabelForeground="{TemplateBinding LabelForeground}" HorizontalAlignment="Left" Visibility="{TemplateBinding DataPagerVisibility}" 
                                                              DisplayMode="{TemplateBinding DisplayMode}" NumericButtonStyle="{TemplateBinding NavigationButtonStyle}"
                                                              MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" FocusBrush="{TemplateBinding FocusBrush}"
                                                              CornerRadius="{TemplateBinding CornerRadius}" ButtonBackground="{TemplateBinding ButtonBackground}" ButtonForeground="{TemplateBinding ButtonForeground}"></c1InputPanel:C1DataPager>
                                    <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
                                        <Button x:Name="Add" Width="35" Height="35" Padding="3" c1:CommandExtensions.Command="c1InputPanel:C1InputPanel.AddNewItemCommand" 
                                                ToolTipService.ToolTip="{Binding Add, Source={StaticResource Resources}}" Background="{TemplateBinding ButtonBackground}" Foreground="{TemplateBinding ButtonForeground}" 
                                    c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" 
                                    c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" Style="{StaticResource ClearStyleButtonStyle}">
                                            <Button.Content>
                                                <Path Style="{StaticResource IconEditor}" Fill="{Binding Foreground, ElementName=Add}" Data="M5.03406,4 C4.48177,4 4.03406,4.44771 4.03406,5 L4.03406,30 L22.0341,30 C23.691,30 25.0341,31.3431 25.0341,33 L25.0341,51 L40.0341,51 C40.5864,51 41.0341,50.5523 41.0341,50 L41.0341,5 C41.0341,4.44771 40.5864,4 40.0341,4 z M3.03405,0 L42.0341,0 C43.691,0 45.0341,1.34315 45.0341,3 L45.0341,52 C45.0341,53.6569 43.691,55 42.0341,55 L24.3462,55 L24.2756,55.0173 C23.6721,55.1342 23.0234,54.9591 22.5561,54.4919 L0.560514,32.4962 C0.140012,32.0757 -0.043883,31.5082 0.008798,30.959 L0.034053,30.7842 L0.034055,3 C0.034056,1.34315 1.3772,0 3.03405,0 z">
                                                    <UIElement.RenderTransform>
                                                        <TransformGroup>
                                                            <ScaleTransform ScaleX="-1" />
                                                        </TransformGroup>
                                                    </UIElement.RenderTransform>
                                                </Path>
                                            </Button.Content>
                                        </Button>
                                        <Button x:Name="Delete" Width="35" Height="35" Padding="3" c1:CommandExtensions.Command="c1InputPanel:C1InputPanel.DeleteCurrentItemCommand" 
                                                ToolTipService.ToolTip="{Binding Delete, Source={StaticResource Resources}}" Background="{TemplateBinding ButtonBackground}" Foreground="{TemplateBinding ButtonForeground}" 
                                    c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" 
                                    c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" Style="{StaticResource ClearStyleButtonStyle}">
                                            <Button.Content>
                                                <Path Style="{StaticResource IconEditor}" Fill="{Binding Foreground, ElementName=Delete}" Data="M4,15 L9,15 L9,46.1104 C9,46.6627 9.44771,47.1104 10,47.1104 L15,47.1104 L15,15 L20,15 L20,47.1104 L26,47.1104 L26,15 L31,15 L31,47.1104 L36,47.1104 C36.5523,47.1104 37,46.6627 37,46.1104 L37,15 L42,15 L42,49 C42,50.6569 40.6569,52 39,52 L7,52 C5.34315,52 4,50.6569 4,49 z M13,0 L33,0 C34.6569,0 36,1.34315 36,3 L36,5 L43,5 C44.6569,5 46,6.34315 46,8 C46,9.65685 44.6569,11 43,11 L3,11 C1.34315,11 0,9.65685 0,8 C0,6.34315 1.34315,5 3,5 L10,5 L10,3 C10,1.34315 11.3431,0 13,0 z">
                                                </Path>
                                            </Button.Content>
                                        </Button>
                                    </StackPanel>
                                </Grid>
                            </Border>
                            <!-- Body -->
                            <Border x:Name="Body" Grid.Row="2">
                                <ScrollViewer x:Name="ItemsScrollViewer" IsTabStop="False" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                    <StackPanel Orientation="Vertical" MinWidth="1" MinHeight="1">
                                        <c1InputPanel:C1InputPanelPresenter x:Name="Presenter" LabelForeground="{TemplateBinding LabelForeground}" ItemsPanelTemplate="{TemplateBinding ItemsPanelTemplate}" c1InputPanel:C1InputPanelPresenter.AutoGenerate="{Binding AutoGenerate, RelativeSource={RelativeSource TemplatedParent}}" />
                                    </StackPanel>
                                </ScrollViewer>
                            </Border>
                            <!-- Validation -->
                            <c1InputPanel:C1InputPanelValidationSummary x:Name="Validation" Grid.Row="3" Background="{TemplateBinding ValidationBackground}"/>
                            <!-- Footer -->
                            <Border x:Name="Footer" Grid.Row="4" Style="{TemplateBinding FooterBorderStyle}">
                                <StackPanel x:Name="FooterPanel" Orientation="Horizontal" HorizontalAlignment="Right">
                                    <Button x:Name="Commit" MinWidth="80" MinHeight="40" Background="{TemplateBinding ButtonBackground}" 
                                            Foreground="{TemplateBinding ButtonForeground}" Style="{StaticResource ClearStyleButtonStyle}" 
                                            c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                            c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" 
                                            c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" Content="{Binding OK, Source={StaticResource Resources}}" 
                                            c1:CommandExtensions.Command="c1InputPanel:C1InputPanel.CommitCommand" FontFamily="{TemplateBinding FontFamily}" 
                                            FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" 
                                            FontWeight="{TemplateBinding FontWeight}"/>
                                    <Button x:Name="Cancel" MinWidth="80" MinHeight="40" Background="{TemplateBinding ButtonBackground}" 
                                            Foreground="{TemplateBinding ButtonForeground}" Style="{StaticResource ClearStyleButtonStyle}" 
                                            c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                            c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" 
                                            c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" Content="{Binding Cancel, Source={StaticResource Resources}}" 
                                            c1:CommandExtensions.Command="c1InputPanel:C1InputPanel.CancelCommand" FontFamily="{TemplateBinding FontFamily}" 
                                            FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" 
                                            FontWeight="{TemplateBinding FontWeight}"/>
                                </StackPanel>
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1InputPanelPresenter -->
    <Style TargetType="c1InputPanel:C1InputPanelPresenter">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputPanelPresenter">
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="GenerateStates">
                                <VisualState x:Name="Auto">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Customized">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Items" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <ItemsControl x:Name="Items" IsTabStop="False" ItemsPanel="{TemplateBinding ItemsPanelTemplate}" ItemsSource="{TemplateBinding c1InputPanel:C1InputPanelPresenter.InputControls}"/>
                            <ContentPresenter x:Name="Content" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1InputBase -->
    <Style x:Key="C1InputBaseStyle" TargetType="c1InputPanel:C1InputBase">
        <Setter Property="Padding" Value="4" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="LabelForeground" Value="{ThemeResource ApplicationForegroundThemeBrush}"/>
        <Setter Property="MouseOverBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="PressedBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="FocusBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="CornerRadius" Value="{ThemeResource GeneralCornerRadius}"/>
        <Setter Property="ButtonBackground" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}"/>
        <Setter Property="ButtonForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputBase">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ReadOnlyStates">
                                <VisualState x:Name="ReadOnlyState">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="EditableState">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}" >
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="120"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="10" />
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="Header" Grid.Column="0" Text="{TemplateBinding Header}" TextWrapping="Wrap" Margin="5 0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="{TemplateBinding LabelForeground}"/>
                            <ContentPresenter x:Name="Content" Grid.Column="1" VerticalAlignment="{TemplateBinding VerticalAlignment}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1InputBase -->
    <Style TargetType="c1InputPanel:C1InputBase" BasedOn="{StaticResource C1InputBaseStyle}">
    </Style>

    <!-- Style C1InputTextBox -->
    <Style TargetType="c1InputPanel:C1InputTextBox" BasedOn="{StaticResource C1InputBaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputTextBox">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ReadOnlyStates">
                                <VisualState x:Name="ReadOnlyState">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MouseOverBrush" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="EditableState">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}" >
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="120"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="10" />
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="Header" Grid.Column="0" Text="{TemplateBinding Header}" TextWrapping="Wrap" Margin="5 0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="{TemplateBinding LabelForeground}"/>
                            <c1:C1TextBoxBase x:Name="Content" Grid.Column="1" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalAlignment}" FontFamily="{TemplateBinding FontFamily}" 
                                              FontSize="{TemplateBinding FontSize}" Background="{TemplateBinding Background}"
                                              MouseOverBrush="{TemplateBinding MouseOverBrush}" FocusBrush="{TemplateBinding FocusBrush}" CornerRadius="{TemplateBinding CornerRadius}" TextWrapping="{TemplateBinding TextWrapping}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1InputComboBox -->
    <Style TargetType="c1InputPanel:C1InputComboBox" BasedOn="{StaticResource C1InputBaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputComboBox">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ReadOnlyStates">
                                <VisualState x:Name="ReadOnlyState">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="EditableState">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}" >
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="120"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="10" />
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="Header" Grid.Column="0" Text="{TemplateBinding Header}" TextWrapping="Wrap" Margin="5 0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="{TemplateBinding LabelForeground}"/>
                            <ComboBox x:Name="Content" Grid.Column="1" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalAlignment}" FontFamily="{TemplateBinding FontFamily}" 
                                      FontSize="{TemplateBinding FontSize}" Background="{TemplateBinding Background}">
                            </ComboBox>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1InputNumericBox -->
    <Style TargetType="c1InputPanel:C1InputNumericBox" BasedOn="{StaticResource C1InputBaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputNumericBox">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ReadOnlyStates">
                                <VisualState x:Name="ReadOnlyState">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="EditableState">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}" >
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="120"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="10" />
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="Header" Grid.Column="0" Text="{TemplateBinding Header}" TextWrapping="Wrap" Margin="5 0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="{TemplateBinding LabelForeground}"/>
                            <c1:C1NumericBox x:Name="Content" Grid.Column="1" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalAlignment}" FontFamily="{TemplateBinding FontFamily}" 
                                             FontSize="{TemplateBinding FontSize}" Background="{TemplateBinding Background}"
                                             MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" FocusBrush="{TemplateBinding FocusBrush}"
                                             CornerRadius="{TemplateBinding CornerRadius}" ButtonBackground="{TemplateBinding ButtonBackground}" ButtonForeground="{TemplateBinding ButtonForeground}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1InputMaskedTextBox -->
    <Style TargetType="c1InputPanel:C1InputMaskedTextBox" BasedOn="{StaticResource C1InputBaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputMaskedTextBox">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ReadOnlyStates">
                                <VisualState x:Name="ReadOnlyState">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MouseOverBrush" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="EditableState">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}" >
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="120"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="10" />
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="Header" Grid.Column="0" Text="{TemplateBinding Header}" TextWrapping="Wrap" Margin="5 0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="{TemplateBinding LabelForeground}"/>
                            <c1:C1MaskedTextBox x:Name="Content" Grid.Column="1" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalAlignment}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" Background="{TemplateBinding Background}"
                                                MouseOverBrush="{TemplateBinding MouseOverBrush}" FocusBrush="{TemplateBinding FocusBrush}" CornerRadius="{TemplateBinding CornerRadius}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Changed Default style for Windows.UI.Xaml.Controls.CheckBox -->
    <Style x:Key="CheckBoxStyle" TargetType="CheckBox">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
        <Setter Property="Padding" Value="8,5,0,0" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="MinWidth" Value="120" />
        <Setter Property="MinHeight" Value="32" />
        <Setter Property="UseSystemFocusVisuals" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CombinedStates">
                                <VisualState x:Name="UncheckedNormal" />
                                <VisualState x:Name="UncheckedPointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UncheckedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="NormalRectangle"
                                                                                     Storyboard.TargetProperty="StrokeThickness"
                                                                                     To="{ThemeResource CheckBoxCheckedStrokeThickness}"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UncheckedDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                                                    Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedNormal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="NormalRectangle"
                                                                                     Storyboard.TargetProperty="StrokeThickness"
                                                                                     To="{ThemeResource CheckBoxCheckedStrokeThickness}"
                                                                                     Duration="0" />
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAltTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseHighBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="NormalRectangle"
                                                                                     Storyboard.TargetProperty="StrokeThickness"
                                                                                     To="{ThemeResource CheckBoxCheckedStrokeThickness}"
                                                                                     Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="CheckedDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                                                    Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="IndeterminateNormal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlForegroundAccentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Glyph">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="&#xE73C;" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="IndeterminatePointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Glyph">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="&#xE73C;" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="IndeterminatePressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightBaseMediumBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlHighlightTransparentBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Glyph">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="&#xE73C;" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="IndeterminateDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Fill">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NormalRectangle"
                                                                                                    Storyboard.TargetProperty="Stroke">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                                                    Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckGlyph"
                                                                                                    Storyboard.TargetProperty="Glyph">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="&#xE73C;" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="CheckGlyph"
                                                                                     Storyboard.TargetProperty="Opacity"
                                                                                     To="1"
                                                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="20" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Border Background="{TemplateBinding Background}"
                                                            BorderBrush="{TemplateBinding BorderBrush}"
                                                            BorderThickness="{TemplateBinding BorderThickness}"
                                                            VerticalAlignment="Top" 
                                                            Height="20">
                            <Grid>
                                <Rectangle x:Name="NormalRectangle"
                                                                      Fill="Transparent"
                                                                      Stroke="{ThemeResource SystemControlForegroundBaseMediumHighBrush}"
                                                                      StrokeThickness="{ThemeResource CheckBoxBorderThemeThickness}"
                                                                      UseLayoutRounding="False"
                                                                      Height="20"
                                                                      Width="20" />
                                <FontIcon x:Name="CheckGlyph"
                                                                      FontFamily="{ThemeResource SymbolThemeFontFamily}"
                                                                      Glyph="&#xE001;"
                                                                      FontSize="20"
                                                                      Foreground="{ThemeResource SystemControlHighlightAltChromeWhiteBrush}"
                                                                      Opacity="0" />
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="ContentPresenter"
                                                                      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 C1InputCheckBox -->
    <Style TargetType="c1InputPanel:C1InputCheckBox" BasedOn="{StaticResource C1InputBaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputCheckBox">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ReadOnlyStates">
                                <VisualState x:Name="ReadOnlyState">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="EditableState">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}" >
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="120"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="10" />
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="Header" Grid.Column="0" Text="{TemplateBinding Header}" TextWrapping="Wrap" Margin="5 0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="{TemplateBinding LabelForeground}"/>
                            <CheckBox x:Name="Content" Style="{StaticResource CheckBoxStyle}" Grid.Column="1" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalAlignment}" Background="{TemplateBinding Background}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1InputDateTimePicker -->
    <Style TargetType="c1InputPanel:C1InputDateTimePicker" BasedOn="{StaticResource C1InputBaseStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1InputDateTimePicker">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="ReadOnlyStates">
                                <VisualState x:Name="ReadOnlyState">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="MouseOverBrush" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlDisabledBaseMediumLowBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="EditableState">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding Padding}" >
                            <Grid.ColumnDefinitions >
                                <ColumnDefinition Width="120"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="10" />
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="Header" Grid.Column="0" Text="{TemplateBinding Header}" TextWrapping="Wrap" Margin="5 0" VerticalAlignment="{TemplateBinding VerticalAlignment}" Foreground="{TemplateBinding LabelForeground}"/>
                            <dt:C1DateTimePicker x:Name="Content" Grid.Column="1" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalAlignment}" FontFamily="{TemplateBinding FontFamily}" 
                                                 FontSize="{TemplateBinding FontSize}" Background="{TemplateBinding Background}"
                                                 MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}" FocusBrush="{TemplateBinding FocusBrush}"
                                                 CornerRadius="{TemplateBinding CornerRadius}" ButtonBackground="{TemplateBinding ButtonBackground}" ButtonForeground="{TemplateBinding ButtonForeground}"/>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Style C1DataPager -->
    <Style TargetType="c1InputPanel:C1DataPager">
        <Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}"/>
        <Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}"/>
        <Setter Property="HorizontalContentAlignment" Value="Right" />
        <Setter Property="LabelForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}"/>
        <Setter Property="NumericButtonStyle" Value="{StaticResource ClearStyleButtonStyle}"/>
        <Setter Property="MouseOverBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="PressedBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="FocusBrush" Value="{ThemeResource SystemControlBackgroundBaseMediumBrush}" />
        <Setter Property="ButtonBackground" Value="{ThemeResource SystemControlBackgroundBaseLowBrush}"/>
        <Setter Property="ButtonForeground" Value="{ThemeResource SystemControlForegroundBaseHighBrush}" />
        <Setter Property="CornerRadius" Value="{ThemeResource GeneralCornerRadius}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1InputPanel:C1DataPager">
                    <Grid x:Name="Root" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <!-- CommonStates -->
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Prefix" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0"/>
                                        <DoubleAnimation Storyboard.TargetName="Suffix" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <!-- CanItemStates -->
                            <VisualStateGroup x:Name="MoveStates">
                                <VisualState x:Name="MoveEnabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentPage" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>True</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                            <!--<DiscreteObjectKeyFrame KeyTime="0" Value=""/>-->
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="MoveDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CurrentPage" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>False</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <!-- CanPageFirstStates -->
                            <VisualStateGroup x:Name="MoveFirstStates">
                                <VisualState x:Name="MoveFirstEnabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstItemButton" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>True</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="FirstItemButton" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="MoveFirstDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstItemButton" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>False</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="FirstItemButton" Storyboard.TargetProperty="Opacity" Duration="0" To="0.4"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <!-- CanPagePreviousStates -->
                            <VisualStateGroup x:Name="MovePreviousStates">
                                <VisualState x:Name="MovePreviousEnabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousItemButton" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>True</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PreviousItemButton" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="MovePreviousDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousItemButton" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>False</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="PreviousItemButton" Storyboard.TargetProperty="Opacity" Duration="0" To="0.4"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <!-- CanPageNextStates -->
                            <VisualStateGroup x:Name="MoveNextStates">
                                <VisualState x:Name="MoveNextEnabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextItemButton" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>True</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="NextItemButton" Storyboard.TargetProperty="Opacity" Duration="0" To="1"/>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="MoveNextDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextItemButton" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>False</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="NextItemButton" Storyboard.TargetProperty="Opacity" Duration="0" To="0.4"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <!-- CanPageLastStates -->
                            <VisualStateGroup x:Name="MoveLastStates">
                                <VisualState x:Name="MoveLastEnabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastItemButton" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>True</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="LastItemButton" Storyboard.TargetProperty="Opacity" Duration="0:0:0.001" To="1"/>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="MoveLastDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastItemButton" Storyboard.TargetProperty="IsEnabled" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <x:Boolean>False</x:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Storyboard.TargetName="LastItemButton" Storyboard.TargetProperty="Opacity" Duration="0:0:0.001" To="0.4"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                            <!-- PagerDisplayModeStates -->
                            <VisualStateGroup x:Name="DisplayModeStates">
                                <VisualState x:Name="FirstLastNumeric">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="FirstLastPreviousNext">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemDisplay" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="FirstLastPreviousNextNumeric">
                                    <Storyboard>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="Numeric">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="NextItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PreviousItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="PreviousNext">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemDisplay" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>

                                <VisualState x:Name="PreviousNextNumeric">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FirstItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LastItemButton" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>
                        <!-- DataPager Control Parts -->
                        <Border MinHeight="30" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="Stretch">
                                <!--FirstPage Button-->
                                <Button x:Name="FirstItemButton" Padding="0" Width="35" Height="35" HorizontalAlignment="Right" VerticalAlignment="Center" Background="{TemplateBinding ButtonBackground}" 
                                            Foreground="{TemplateBinding ButtonForeground}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                            c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" 
                                            c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" c1:CommandExtensions.Command="c1:C1DataPager.MoveToFirstCommand" 
                                            ToolTipService.ToolTip="{Binding First, Source={StaticResource Resources}}" Style="{TemplateBinding NumericButtonStyle}">
                                    <Button.Content>
                                        <Grid Height="14" Width="14">
                                            <Rectangle Width="2" HorizontalAlignment="Left" Fill="{Binding Foreground, ElementName=FirstItemButton}"/>
                                            <Path Data="M0,1 L1,0 L1,2 Z" Style="{StaticResource NavigationPath}" HorizontalAlignment="Right" Fill="{Binding Foreground, ElementName=FirstItemButton}"/>
                                        </Grid>
                                    </Button.Content>
                                </Button>

                                <!--PreviousPage Button-->
                                <Button x:Name="PreviousItemButton" Padding="0" Width="35" Height="35" HorizontalAlignment="Right" VerticalAlignment="Center" Background="{TemplateBinding ButtonBackground}" 
                                            Foreground="{TemplateBinding ButtonForeground}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                            c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" 
                                            c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" c1:CommandExtensions.Command="c1:C1DataPager.MoveToPreviousCommand" 
                                            ToolTipService.ToolTip="{Binding Previous, Source={StaticResource Resources}}" Style="{TemplateBinding NumericButtonStyle}">
                                    <Button.Content>
                                        <Path Data="M0,1 L1,0 L1,2 Z" Style="{StaticResource NavigationPath}" HorizontalAlignment="Center" Fill="{Binding Foreground, ElementName=PreviousItemButton}"/>
                                    </Button.Content>
                                </Button>

                                <!--Page Display-->
                                <StackPanel x:Name="ItemDisplay" Orientation="Horizontal" Margin="3 0 3 0">
                                    <TextBlock x:Name="Prefix" Width="Auto" VerticalAlignment="Center" Margin="4,0,2,0" Text="{Binding PagerPrefix, Source={StaticResource Resources}}" Foreground="{TemplateBinding LabelForeground}"/>
                                    <c1:C1TextBoxBase x:Name="CurrentPage" MinWidth="30" MaxWidth="50" MinHeight="20" VerticalAlignment="Center" VerticalContentAlignment="Center" Foreground="{TemplateBinding Foreground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}"/>
                                    <TextBlock x:Name="Suffix" Width="Auto" VerticalAlignment="Center" Margin="2,0,4,0" Foreground="{TemplateBinding LabelForeground}"/>
                                </StackPanel>

                                <!--NextPage Button-->
                                <Button x:Name="NextItemButton" Padding="0" Width="35" Height="35" HorizontalAlignment="Right" VerticalAlignment="Center" Background="{TemplateBinding ButtonBackground}" 
                                            Foreground="{TemplateBinding ButtonForeground}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                            c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" 
                                            c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" c1:CommandExtensions.Command="c1:C1DataPager.MoveToNextCommand" 
                                            ToolTipService.ToolTip="{Binding Next, Source={StaticResource Resources}}" Style="{TemplateBinding NumericButtonStyle}">
                                    <Button.Content>
                                        <Path Data="M0,0 L1,1 L0,2 Z" Style="{StaticResource NavigationPath}" HorizontalAlignment="Center" Fill="{Binding Foreground, ElementName=NextItemButton}"/>
                                    </Button.Content>
                                </Button>

                                <!--LastPage Button-->
                                <Button x:Name="LastItemButton" Padding="0" Width="35" Height="35" HorizontalAlignment="Right" VerticalAlignment="Center" Background="{TemplateBinding ButtonBackground}" 
                                            Foreground="{TemplateBinding ButtonForeground}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" 
                                            c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" 
                                            c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" c1:CommandExtensions.Command="c1:C1DataPager.MoveToLastCommand" 
                                            ToolTipService.ToolTip="{Binding Last, Source={StaticResource Resources}}" Style="{TemplateBinding NumericButtonStyle}">
                                    <Button.Content>
                                        <Grid Height="14" Width="14">
                                            <Path Data="M0,0 L1,1 L0,2 Z" Style="{StaticResource NavigationPath}" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="{Binding Foreground, ElementName=LastItemButton}"/>
                                            <Rectangle Width="2" HorizontalAlignment="Right" Fill="{Binding Foreground, ElementName=LastItemButton}"/>
                                        </Grid>
                                    </Button.Content>
                                </Button>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>