<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:data="using:Wino.Calendar.ViewModels.Data"
    xmlns:local="using:Wino.Mail.WinUI.Styles"
    xmlns:selectors1="using:Wino.Selectors">

    <Style x:Key="WinoCalendarViewStyle" TargetType="CalendarView">
        <Setter Property="BlackoutStrikethroughBrush" Value="{ThemeResource CalendarViewBlackoutStrikethroughBrush}" />
        <Setter Property="SelectedHoverBorderBrush" Value="{ThemeResource CalendarViewSelectedHoverBorderBrush}" />
        <Setter Property="SelectedPressedBorderBrush" Value="{ThemeResource CalendarViewSelectedPressedBorderBrush}" />
        <Setter Property="SelectedDisabledBorderBrush" Value="{ThemeResource CalendarViewSelectedDisabledBorderBrush}" />
        <Setter Property="SelectedBorderBrush" Value="{ThemeResource CalendarViewSelectedBorderBrush}" />
        <Setter Property="HoverBorderBrush" Value="{ThemeResource CalendarViewHoverBorderBrush}" />
        <Setter Property="PressedBorderBrush" Value="{ThemeResource CalendarViewPressedBorderBrush}" />
        <Setter Property="CalendarItemBorderBrush" Value="{ThemeResource CalendarViewCalendarItemBorderBrush}" />
        <Setter Property="TodaySelectedInnerBorderBrush" Value="{ThemeResource CalendarViewTodaySelectedInnerBorderBrush}" />
        <Setter Property="TodayForeground" Value="{ThemeResource CalendarViewTodayForeground}" />
        <Setter Property="DisabledForeground" Value="{ThemeResource CalendarViewDisabledForeground}" />
        <Setter Property="BlackoutForeground" Value="{ThemeResource CalendarViewBlackoutForeground}" />
        <Setter Property="SelectedForeground" Value="{ThemeResource CalendarViewSelectedForeground}" />
        <Setter Property="SelectedHoverForeground" Value="{ThemeResource CalendarViewSelectedHoverForeground}" />
        <Setter Property="SelectedPressedForeground" Value="{ThemeResource CalendarViewSelectedPressedForeground}" />
        <Setter Property="SelectedDisabledForeground" Value="{ThemeResource CalendarViewSelectedDisabledForeground}" />
        <Setter Property="PressedForeground" Value="{ThemeResource CalendarViewPressedForeground}" />
        <Setter Property="OutOfScopeForeground" Value="{ThemeResource CalendarViewOutOfScopeForeground}" />
        <Setter Property="OutOfScopeHoverForeground" Value="{ThemeResource CalendarViewOutOfScopeHoverForeground}" />
        <Setter Property="OutOfScopePressedForeground" Value="{ThemeResource CalendarViewOutOfScopePressedForeground}" />
        <Setter Property="CalendarItemForeground" Value="{ThemeResource CalendarViewCalendarItemForeground}" />
        <Setter Property="TodayBackground" Value="{ThemeResource CalendarViewTodayBackground}" />
        <Setter Property="TodayBlackoutBackground" Value="{ThemeResource CalendarViewTodayBlackoutBackground}" />
        <Setter Property="TodayBlackoutForeground" Value="{ThemeResource CalendarViewTodayBlackoutForeground}" />
        <Setter Property="TodayHoverBackground" Value="{ThemeResource CalendarViewTodayHoverBackground}" />
        <Setter Property="TodayPressedBackground" Value="{ThemeResource CalendarViewTodayPressedBackground}" />
        <Setter Property="TodayDisabledBackground" Value="{ThemeResource CalendarViewTodayDisabledBackground}" />
        <Setter Property="BlackoutBackground" Value="{ThemeResource CalendarViewBlackoutBackground}" />
        <Setter Property="OutOfScopeBackground" Value="{ThemeResource CalendarViewOutOfScopeBackground}" />
        <Setter Property="CalendarItemBackground" Value="{ThemeResource CalendarViewCalendarItemBackground}" />
        <Setter Property="CalendarItemHoverBackground" Value="{ThemeResource CalendarViewCalendarItemHoverBackground}" />
        <Setter Property="CalendarItemPressedBackground" Value="{ThemeResource CalendarViewCalendarItemPressedBackground}" />
        <Setter Property="CalendarItemDisabledBackground" Value="{ThemeResource CalendarViewCalendarItemDisabledBackground}" />
        <Setter Property="Foreground" Value="{ThemeResource CalendarViewForeground}" />
        <Setter Property="Background" Value="{ThemeResource CalendarViewBackground}" />
        <Setter Property="BorderBrush" Value="{ThemeResource CalendarViewBorderBrush}" />
        <Setter Property="DayItemFontFamily" Value="XamlAutoFontFamily" />
        <Setter Property="DayItemFontSize" Value="{ThemeResource CalendarViewDayItemFontSize}" />
        <Setter Property="DayItemMargin" Value="{ThemeResource CalendarViewDayItemMargin}" />
        <Setter Property="FirstOfMonthLabelFontFamily" Value="XamlAutoFontFamily" />
        <Setter Property="FirstOfMonthLabelFontSize" Value="{ThemeResource CalendarViewFirstOfMonthLabelFontSize}" />
        <Setter Property="FirstOfMonthLabelMargin" Value="{ThemeResource CalendarViewFirstOfMonthLabelMargin}" />
        <Setter Property="MonthYearItemFontFamily" Value="XamlAutoFontFamily" />
        <Setter Property="MonthYearItemFontSize" Value="{ThemeResource CalendarViewMonthYearItemFontSize}" />
        <Setter Property="MonthYearItemMargin" Value="{ThemeResource CalendarViewMonthYearItemMargin}" />
        <Setter Property="FirstOfYearDecadeLabelFontFamily" Value="XamlAutoFontFamily" />
        <Setter Property="FirstOfYearDecadeLabelFontSize" Value="{ThemeResource CalendarViewFirstOfYearDecadeLabelFontSize}" />
        <Setter Property="FirstOfYearDecadeLabelMargin" Value="{ThemeResource CalendarViewFirstOfYearDecadeLabelMargin}" />
        <Setter Property="TodayFontWeight" Value="{ThemeResource CalendarViewTodayFontWeight}" />
        <Setter Property="CalendarItemBorderThickness" Value="1" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
        <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CalendarView">
                    <Border
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="{TemplateBinding CornerRadius}">
                        <Border.Resources>
                            <Style
                                x:Key="WeekDayNameStyle"
                                BasedOn="{StaticResource CaptionTextBlockStyle}"
                                TargetType="TextBlock">
                                <Setter Property="HorizontalAlignment" Value="Center" />
                                <Setter Property="VerticalAlignment" Value="Center" />
                                <Setter Property="FontWeight" Value="{ThemeResource CalendarViewWeekDayFontWeight}" />
                                <Setter Property="Margin" Value="{ThemeResource CalendarViewWeekDayMargin}" />
                                <Setter Property="Padding" Value="{ThemeResource CalendarViewWeekDayPadding}" />
                            </Style>
                            <Style x:Key="HeaderNavigationButtonStyle" TargetType="Button">
                                <Setter Property="HorizontalAlignment" Value="Stretch" />
                                <Setter Property="VerticalAlignment" Value="Stretch" />
                                <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
                                <Setter Property="FontSize" Value="{ThemeResource CalendarViewHeaderNavigationButtonFontSize}" />
                                <Setter Property="FontWeight" Value="{ThemeResource CalendarViewHeaderNavigationFontWeight}" />
                                <Setter Property="Background" Value="{ThemeResource CalendarViewNavigationButtonBackground}" />
                                <Setter Property="Margin" Value="{ThemeResource CalendarViewHeaderNavigationButtonMargin}" />
                                <Setter Property="Padding" Value="{ThemeResource CalendarViewHeaderNavigationButtonPadding}" />
                                <Setter Property="BackgroundSizing" Value="InnerBorderEdge" />
                                <Setter Property="CornerRadius" Value="{StaticResource ControlCornerRadius}" />
                                <Setter Property="FocusVisualMargin" Value="{StaticResource CalendarViewNavigationButtonFocusVisualMargin}" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <ContentPresenter
                                                x:Name="Text"
                                                Padding="{TemplateBinding Padding}"
                                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                AutomationProperties.AccessibilityView="Raw"
                                                Background="{TemplateBinding Background}"
                                                BackgroundSizing="{TemplateBinding BackgroundSizing}"
                                                BorderBrush="{ThemeResource CalendarViewNavigationButtonBorderBrush}"
                                                BorderThickness="{TemplateBinding BorderThickness}"
                                                Content="{TemplateBinding Content}"
                                                CornerRadius="{TemplateBinding CornerRadius}"
                                                Foreground="{TemplateBinding Foreground}">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="PointerOver">
                                                            <VisualState.Setters>
                                                                <Setter Target="Text.Background" Value="{ThemeResource CalendarViewNavigationButtonBackgroundPointerOver}" />
                                                                <Setter Target="Text.BorderBrush" Value="{ThemeResource CalendarViewNavigationButtonBorderBrushPointerOver}" />
                                                                <Setter Target="Text.Foreground" Value="{ThemeResource CalendarViewHeaderNavigationButtonForegroundPointerOver}" />
                                                            </VisualState.Setters>
                                                        </VisualState>
                                                        <VisualState x:Name="Pressed">
                                                            <VisualState.Setters>
                                                                <Setter Target="Text.Background" Value="{ThemeResource CalendarViewNavigationButtonBackgroundPressed}" />
                                                                <Setter Target="Text.Foreground" Value="{ThemeResource CalendarViewHeaderNavigationButtonForegroundPressed}" />
                                                            </VisualState.Setters>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <VisualState.Setters>
                                                                <Setter Target="Text.Foreground" Value="{ThemeResource CalendarViewHeaderNavigationButtonForegroundDisabled}" />
                                                            </VisualState.Setters>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                            </ContentPresenter>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style x:Key="NavigationButtonStyle" TargetType="Button">
                                <Setter Property="HorizontalAlignment" Value="Stretch" />
                                <Setter Property="VerticalAlignment" Value="Stretch" />
                                <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
                                <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
                                <Setter Property="FontSize" Value="{ThemeResource CalendarViewNavigationButtonFontSize}" />
                                <Setter Property="Background" Value="{ThemeResource CalendarViewNavigationButtonBackground}" />
                                <Setter Property="Padding" Value="{ThemeResource CalendarViewNavigationButtonPadding}" />
                                <Setter Property="BackgroundSizing" Value="InnerBorderEdge" />
                                <Setter Property="CornerRadius" Value="{StaticResource ControlCornerRadius}" />
                                <Setter Property="FocusVisualMargin" Value="{StaticResource CalendarViewNavigationButtonFocusVisualMargin}" />
                                <Setter Property="IsTabStop" Value="True" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <ContentPresenter
                                                x:Name="Text"
                                                Padding="{TemplateBinding Padding}"
                                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                                AutomationProperties.AccessibilityView="Raw"
                                                Background="{TemplateBinding Background}"
                                                BackgroundSizing="{TemplateBinding BackgroundSizing}"
                                                BorderBrush="{ThemeResource CalendarViewNavigationButtonBorderBrush}"
                                                BorderThickness="{TemplateBinding BorderThickness}"
                                                Content="{TemplateBinding Content}"
                                                CornerRadius="{TemplateBinding CornerRadius}">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="PointerOver">
                                                            <VisualState.Setters>
                                                                <Setter Target="Text.Background" Value="{ThemeResource CalendarViewNavigationButtonBackgroundPointerOver}" />
                                                                <Setter Target="Text.BorderBrush" Value="{ThemeResource CalendarViewNavigationButtonBorderBrushPointerOver}" />
                                                                <Setter Target="Text.Foreground" Value="{ThemeResource CalendarViewNavigationButtonForegroundPointerOver}" />
                                                            </VisualState.Setters>
                                                        </VisualState>
                                                        <VisualState x:Name="Pressed">
                                                            <VisualState.Setters>
                                                                <Setter Target="Text.Background" Value="{ThemeResource CalendarViewNavigationButtonBackgroundPressed}" />
                                                                <Setter Target="Text.Foreground" Value="{ThemeResource CalendarViewNavigationButtonForegroundPressed}" />
                                                            </VisualState.Setters>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <VisualState.Setters>
                                                                <Setter Target="Text.Foreground" Value="{ThemeResource CalendarViewNavigationButtonForegroundDisabled}" />
                                                            </VisualState.Setters>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                            </ContentPresenter>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style x:Key="ScrollViewerStyle" TargetType="ScrollViewer">
                                <Setter Property="HorizontalScrollMode" Value="Disabled" />
                                <Setter Property="VerticalScrollMode" Value="Enabled" />
                                <Setter Property="VerticalSnapPointsType" Value="Optional" />
                                <Setter Property="ZoomMode" Value="Disabled" />
                                <Setter Property="TabNavigation" Value="Once" />
                                <Setter Property="BringIntoViewOnFocusChange" Value="False" />
                                <Setter Property="Template" Value="{StaticResource ScrollViewerScrollBarlessTemplate}" />
                            </Style>
                        </Border.Resources>
                        <Grid
                            MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.MinViewWidth}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Button
                                    x:Name="HeaderButton"
                                    HorizontalContentAlignment="Left"
                                    Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HeaderText}"
                                    Foreground="{TemplateBinding Foreground}"
                                    IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HasMoreViews}"
                                    Style="{StaticResource HeaderNavigationButtonStyle}" />
                                <Button
                                    x:Name="PreviousButton"
                                    Grid.Column="1"
                                    Margin="{ThemeResource CalendarViewNavigationPreviousButtonMargin}"
                                    HorizontalContentAlignment="Center"
                                    Content="&#xEDDB;"
                                    Foreground="{TemplateBinding Foreground}"
                                    IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HasMoreContentBefore}"
                                    Style="{StaticResource NavigationButtonStyle}" />
                                <Button
                                    x:Name="NextButton"
                                    Grid.Column="2"
                                    Margin="{ThemeResource CalendarViewNavigationNextButtonMargin}"
                                    HorizontalContentAlignment="Center"
                                    Content="&#xEDDC;"
                                    Foreground="{TemplateBinding Foreground}"
                                    IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.HasMoreContentAfter}"
                                    Style="{StaticResource NavigationButtonStyle}" />
                            </Grid>
                            <Border
                                Grid.Row="1"
                                Height="1"
                                Background="{TemplateBinding BorderBrush}" />
                            <Grid x:Name="Views" Grid.Row="2">
                                <Grid.Clip>
                                    <RectangleGeometry Rect="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClipRect}" />
                                </Grid.Clip>
                                <Border x:Name="BackgroundLayer">
                                    <Border.RenderTransform>
                                        <ScaleTransform x:Name="BackgroundTransform" CenterX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CenterX}" CenterY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CenterY}" />
                                    </Border.RenderTransform>
                                </Border>
                                <Grid x:Name="MonthView">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <Grid.RenderTransform>
                                        <ScaleTransform x:Name="MonthViewTransform" CenterX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CenterX}" CenterY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CenterY}" />
                                    </Grid.RenderTransform>
                                    <Grid
                                        x:Name="WeekDayNames"
                                        Margin="2,2,2,0"
                                        Background="{TemplateBinding Background}">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>
                                        <TextBlock
                                            x:Name="WeekDay1"
                                            Foreground="{TemplateBinding CalendarItemForeground}"
                                            Style="{StaticResource WeekDayNameStyle}"
                                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.WeekDay1}" />
                                        <TextBlock
                                            x:Name="WeekDay2"
                                            Grid.Column="1"
                                            Foreground="{TemplateBinding CalendarItemForeground}"
                                            Style="{StaticResource WeekDayNameStyle}"
                                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.WeekDay2}" />
                                        <TextBlock
                                            x:Name="WeekDay3"
                                            Grid.Column="2"
                                            Foreground="{TemplateBinding CalendarItemForeground}"
                                            Style="{StaticResource WeekDayNameStyle}"
                                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.WeekDay3}" />
                                        <TextBlock
                                            x:Name="WeekDay4"
                                            Grid.Column="3"
                                            Foreground="{TemplateBinding CalendarItemForeground}"
                                            Style="{StaticResource WeekDayNameStyle}"
                                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.WeekDay4}" />
                                        <TextBlock
                                            x:Name="WeekDay5"
                                            Grid.Column="4"
                                            Foreground="{TemplateBinding CalendarItemForeground}"
                                            Style="{StaticResource WeekDayNameStyle}"
                                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.WeekDay5}" />
                                        <TextBlock
                                            x:Name="WeekDay6"
                                            Grid.Column="5"
                                            Foreground="{TemplateBinding CalendarItemForeground}"
                                            Style="{StaticResource WeekDayNameStyle}"
                                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.WeekDay6}" />
                                        <TextBlock
                                            x:Name="WeekDay7"
                                            Grid.Column="6"
                                            Foreground="{TemplateBinding CalendarItemForeground}"
                                            Style="{StaticResource WeekDayNameStyle}"
                                            Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.WeekDay7}" />
                                    </Grid>
                                    <ScrollViewer
                                        x:Name="MonthViewScrollViewer"
                                        Grid.Row="1"
                                        Margin="2"
                                        IsFocusEngagementEnabled="True"
                                        Style="{StaticResource ScrollViewerStyle}">
                                        <CalendarPanel x:Name="MonthViewPanel" />
                                    </ScrollViewer>
                                </Grid>
                                <ScrollViewer
                                    x:Name="YearViewScrollViewer"
                                    Margin="2"
                                    IsFocusEngagementEnabled="True"
                                    Style="{StaticResource ScrollViewerStyle}"
                                    UseLayoutRounding="False"
                                    Visibility="Collapsed">
                                    <ScrollViewer.RenderTransform>
                                        <ScaleTransform x:Name="YearViewTransform" CenterX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CenterX}" CenterY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CenterY}" />
                                    </ScrollViewer.RenderTransform>
                                    <CalendarPanel x:Name="YearViewPanel" />
                                </ScrollViewer>
                                <ScrollViewer
                                    x:Name="DecadeViewScrollViewer"
                                    Margin="2"
                                    IsFocusEngagementEnabled="True"
                                    Style="{StaticResource ScrollViewerStyle}"
                                    UseLayoutRounding="False"
                                    Visibility="Collapsed">
                                    <ScrollViewer.RenderTransform>
                                        <ScaleTransform x:Name="DecadeViewTransform" CenterX="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CenterX}" CenterY="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.CenterY}" />
                                    </ScrollViewer.RenderTransform>
                                    <CalendarPanel x:Name="DecadeViewPanel" />
                                </ScrollViewer>
                            </Grid>
                        </Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WeekDay1" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarViewWeekDayForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WeekDay2" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarViewWeekDayForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WeekDay3" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarViewWeekDayForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WeekDay4" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarViewWeekDayForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WeekDay5" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarViewWeekDayForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WeekDay6" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarViewWeekDayForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="WeekDay7" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarViewWeekDayForegroundDisabled}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="HeaderButtonStates">
                                <VisualState x:Name="ViewChanged" />
                                <VisualState x:Name="ViewChanging">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Storyboard.TargetName="HeaderButton"
                                            Storyboard.TargetProperty="Opacity"
                                            From="0"
                                            To="1"
                                            Duration="0:0:0.167" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DisplayModeStates">
                                <VisualState x:Name="Month" />
                                <VisualState x:Name="Year">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MonthViewScrollViewer" Storyboard.TargetProperty="IsEnabled">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MonthView" Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Decade">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MonthViewScrollViewer" Storyboard.TargetProperty="IsEnabled">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="False" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MonthView" Storyboard.TargetProperty="Opacity">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="0" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewScrollViewer" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="Month" To="Year">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MonthView" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MonthViewTransform" Storyboard.TargetProperty="ScaleX">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="0.84" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MonthViewTransform" Storyboard.TargetProperty="ScaleY">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="0.84" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="1.29" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="1.29" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundLayer" Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.000" Value="0" />
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.200" Value="0" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Year" To="Month">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="False" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MonthView" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewTransform" Storyboard.TargetProperty="ScaleX">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="1.29" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewTransform" Storyboard.TargetProperty="ScaleY">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="1.29" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MonthViewTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0.84" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MonthViewTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0.84" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0.84" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0.84" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundLayer" Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.000" Value="0" />
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.200" Value="0" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Year" To="Decade">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MonthView" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewScrollViewer" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewScrollViewer" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewTransform" Storyboard.TargetProperty="ScaleX">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="0.84" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewTransform" Storyboard.TargetProperty="ScaleY">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="0.84" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="1.29" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="1.29" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundLayer" Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.000" Value="0" />
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.200" Value="0" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                    <VisualTransition From="Decade" To="Year">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MonthView" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewScrollViewer" Storyboard.TargetProperty="Visibility">
                                                <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewScrollViewer" Storyboard.TargetProperty="IsHitTestVisible">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="False" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewScrollViewer" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="0" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewScrollViewer" Storyboard.TargetProperty="Opacity">
                                                <DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewTransform" Storyboard.TargetProperty="ScaleX">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="1.29" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DecadeViewTransform" Storyboard.TargetProperty="ScaleY">
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.150"
                                                    Value="1.29" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0.84" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="YearViewTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0.84" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundTransform" Storyboard.TargetProperty="ScaleX">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0.84" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundTransform" Storyboard.TargetProperty="ScaleY">
                                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.150" Value="0.84" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundLayer" Storyboard.TargetProperty="Opacity">
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.000" Value="0" />
                                                <LinearDoubleKeyFrame KeyTime="0:0:0.200" Value="0" />
                                                <SplineDoubleKeyFrame
                                                    KeySpline="{StaticResource ControlFastOutSlowInKeySpline}"
                                                    KeyTime="0:0:0.500"
                                                    Value="1" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



</ResourceDictionary>
