<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:c1calendar="using:C1.Xaml.Calendar"
    xmlns:res="using:C1.Silverlight.Calendar.Resources">

    <res:C1_Silverlight_Calendar x:Key="CalendarResources"/>

    <c1calendar:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <Style TargetType="c1calendar:DaySlotPresenter">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:DaySlotPresenter">
                    <Grid Background="{TemplateBinding Background}" 
                          BorderThickness="1" BorderBrush="{Binding Path=Calendar.DayBorderBrush}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="selection" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected"/>
                                <VisualState x:Name="SelectedUnfocused"/>
                                <VisualState x:Name="SelectedPointerOver"/>
                                <VisualState x:Name="SelectedPressed"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="selection" Fill="{Binding Path=Calendar.SelectedDayBrush, RelativeSource={RelativeSource TemplatedParent}}" />
                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1calendar:ViewSlotPresenter">
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:ViewSlotPresenter">
                    <Grid Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="selection" Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected"/>
                                <VisualState x:Name="SelectedUnfocused"/>
                                <VisualState x:Name="SelectedPointerOver"/>
                                <VisualState x:Name="SelectedPressed"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="selection" Fill="{Binding Path=Calendar.SelectedDayBrush, RelativeSource={RelativeSource TemplatedParent}}"/>
                        <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"
                            Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1calendar:DayOfWeekSlotPresenter">
        <Setter Property="Padding" Value="8,3,0,3"/>
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Bottom"/>
        <Setter Property="BorderThickness" Value="0,0,0,1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:DayOfWeekSlotPresenter">
                    <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}"
                            BorderBrush="{Binding Path=Calendar.DaysOfWeekBorderBrush, RelativeSource={RelativeSource TemplatedParent}}">
                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Width="40" Height="20"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1calendar:DaysOfWeekPresenter">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:DaysOfWeekPresenter">
                    <ItemsPresenter />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <c1:C1UniformGrid Columns="7" Rows="1"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1calendar:WeekNumberSlotPresenter">
        <Setter Property="Padding" Value="3,3,4,5"/>
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="VerticalContentAlignment" Value="Bottom"/>
         <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:WeekNumberSlotPresenter">
                    <Border Background="Transparent" BorderThickness="0,0,1,0" BorderBrush="{Binding Calendar.DaysOfWeekBorderBrush}">
                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Width="20" Height="20"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1calendar:WeekNumbersPresenter">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:WeekNumbersPresenter">
                    <ItemsPresenter/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <c1:C1UniformGrid Rows="6" Columns="1"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1calendar:C1CalendarPresenter">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:C1CalendarPresenter">
                    <ItemsPresenter/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <c1:C1UniformGrid Columns="7" Rows="6"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1calendar:C1CalendarViewPresenter">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:C1CalendarViewPresenter">
                    <ItemsPresenter/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <c1:C1UniformGrid Columns="3" Rows="4"/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <SolidColorBrush x:Key="HighlightBorderThemeBrush" Color="{ThemeResource SystemColorHighlightColor}" />
    <SolidColorBrush x:Key="CalendarButtonPointerOverBackgroundThemeBrush" Color="#6638a3ff"/>
    <SolidColorBrush x:Key="CalendarButtonPressedBackgroundThemeBrush" Color="#66006fd0"/>
    
    <Style x:Key="NavigationButtonStyle" TargetType="Button">
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="FontSize" Value="{ThemeResource ComboBoxArrowThemeFontSize}"/>
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}"/>
        <Setter Property="Opacity" Value="0.85"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Foreground" Value="{ThemeResource ButtonForegroundThemeBrush}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource ButtonBorderThemeBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Height" Value="46" />
        <Setter Property="Width" Value="46" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarButtonPointerOverBackgroundThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource CalendarButtonPressedBackgroundThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledBackgroundThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledBorderThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledForegroundThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="PointerFocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Margin="3">
                            <ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <Rectangle x:Name="FocusVisualWhite" IsHitTestVisible="False" Visibility="Collapsed" StrokeDashOffset="1.5" StrokeEndLineCap="Square" Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}" StrokeDashArray="1,1"/>
                        <Rectangle x:Name="FocusVisualBlack" IsHitTestVisible="False" Visibility="Collapsed" StrokeDashOffset="0.5" StrokeEndLineCap="Square" Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}" StrokeDashArray="1,1"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TodayButtonStyle" TargetType="Button">
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Margin" Value="0,6,0,6"/>
    </Style>

    <!-- C1Calendar -->
    <Style TargetType="c1calendar:C1Calendar" x:Key="BaseCalendarStyle" >
        <Setter Property="TabNavigation" Value="Once" />
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Margin" Value="0" />
        <Setter Property="Padding" Value="0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}" />
        <Setter Property="MonthHeaderBackground" Value="Transparent" />
        <Setter Property="SelectedDayBrush" Value="{ThemeResource SystemControlHighlightListAccentLowBrush}"/>
        <Setter Property="Foreground" Value="{ThemeResource AppBarItemForegroundThemeBrush}" />
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="MonthHeaderForeground" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="WeekendBrush" Value="{ThemeResource DefaultTextForegroundThemeBrush}" />
        <Setter Property="DisabledDayBrush" Value="{ThemeResource TextBoxDisabledForegroundThemeBrush}" />
        <Setter Property="AdjacentDayBrush" Value="{ThemeResource TextBoxDisabledForegroundThemeBrush}"/>
        <Setter Property="DayBorderBrush" Value="{ThemeResource AppBarBorderThemeBrush}"/>
        <Setter Property="DaysOfWeekBorderBrush" Value="{ThemeResource HighlightBorderThemeBrush}" />
        <Setter Property="TodayBrush" Value="{ThemeResource SystemControlHighlightAccentBrush}" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="MonthHeaderFontSize" Value="21" />
        <Setter Property="MonthHeaderFontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="ButtonStyle" Value="{StaticResource NavigationButtonStyle}" />
        <Setter Property="TodayButtonStyle" Value="{StaticResource TodayButtonStyle}" />
    </Style>

    <Style TargetType="c1calendar:C1Calendar" BasedOn="{StaticResource BaseCalendarStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1calendar:C1Calendar">
                    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                          Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
						  BorderThickness="{TemplateBinding BorderThickness}" FlowDirection="LeftToRight">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <ItemsControl x:Name="PART_FlipView" FlowDirection="{TemplateBinding FlowDirection}" Grid.Row="0">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <!-- DataContext is the C1CalendarViewModel object-->
                                    <Grid x:Name="Content" >
                                        <Grid.Resources>
                                            <Storyboard x:Name="MonthFadeIn">
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MonthView" Storyboard.TargetProperty="Visibility"
                                                               Duration="0" FillBehavior="HoldEnd">
                                                    <ObjectAnimationUsingKeyFrames.KeyFrames>
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <Visibility>Visible</Visibility>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames.KeyFrames>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="YearDecadeView" Storyboard.TargetProperty="Visibility"
                                                               Duration="0" FillBehavior="HoldEnd">
                                                    <ObjectAnimationUsingKeyFrames.KeyFrames>
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <Visibility>Collapsed</Visibility>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames.KeyFrames>
                                                </ObjectAnimationUsingKeyFrames>
                                                <PopInThemeAnimation Storyboard.TargetName="MonthView" Duration="0:0:0.5" FromHorizontalOffset="80" />
                                            </Storyboard>
                                            <Storyboard x:Name="YearFadeIn">
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="YearDecadeView" Storyboard.TargetProperty="Visibility"
                                                               Duration="0" FillBehavior="HoldEnd">
                                                    <ObjectAnimationUsingKeyFrames.KeyFrames>
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <Visibility>Visible</Visibility>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames.KeyFrames>
                                                </ObjectAnimationUsingKeyFrames>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MonthView" Storyboard.TargetProperty="Visibility"
                                                               Duration="0" FillBehavior="HoldEnd">
                                                    <ObjectAnimationUsingKeyFrames.KeyFrames>
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <Visibility>Collapsed</Visibility>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames.KeyFrames>
                                                </ObjectAnimationUsingKeyFrames>
                                                <PopInThemeAnimation Storyboard.TargetName="YearDecadeView" Duration="0:0:0.5" FromHorizontalOffset="80" />
                                            </Storyboard>
                                        </Grid.Resources>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <!-- month header -->
                                        <Border Grid.Row="0" x:Name="MonthHeader"
                                                    Visibility="{Binding Path=Calendar.ShowMonthHeader, Converter={StaticResource BooleanToVisibilityConverter}}"
                                                    Background="{Binding Calendar.MonthHeaderBackground}">
                                            <TextBlock Text="{Binding MonthHeader}" Grid.Column="1" Margin="0,8,0,12"
                                                    Foreground="{Binding Path=Calendar.MonthHeaderForeground}" FontSize="{Binding Path=Calendar.MonthHeaderFontSize}"
                                                    FontFamily="{Binding Path=Calendar.MonthHeaderFontFamily}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                        </Border>
                                        <Grid x:Name="MonthView" Grid.Row="1">
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition />
                                            </Grid.RowDefinitions>
                                            <!-- days of week names -->
                                            <Grid IsHitTestVisible="False" Grid.Row="0">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto"/>
                                                    <ColumnDefinition/>
                                                </Grid.ColumnDefinitions>
                                                <Rectangle Grid.Column="0" Width="32" Visibility="{Binding Path=Calendar.ShowWeekNumbers, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                                                <c1calendar:DaysOfWeekPresenter x:Name="DaysOfWeekPresenter" Grid.Column="1"/>
                                            </Grid>
                                            <Grid Grid.Row="1">
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto"/>
                                                    <ColumnDefinition/>
                                                </Grid.ColumnDefinitions>
                                                <!-- week numbers -->
                                                <c1calendar:WeekNumbersPresenter x:Name="WeekNumbersPresenter" Grid.Column="0" Width="32"
                                                        Visibility="{Binding Path=Calendar.ShowWeekNumbers, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                                                <!-- days -->
                                                <c1calendar:C1CalendarPresenter x:Name="CalendarPresenter" Grid.Column="1"/>
                                            </Grid>
                                        </Grid>
                                        <c1calendar:C1CalendarViewPresenter x:Name="YearDecadeView" Grid.Row="1" Visibility="Collapsed"/>
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <c1calendar:C1LoopPanel/>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                        </ItemsControl>
                        <Grid Visibility="{Binding ShowMonthHeader, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" 
                              Grid.Row="0" VerticalAlignment="Top" FlowDirection="LeftToRight" Margin="{TemplateBinding BorderThickness}">
                            <Button Content="&#xe012;" x:Name="ButtonBack" HorizontalAlignment="Left" Visibility="Collapsed"
                                    AutomationProperties.HelpText="{Binding Previous, Source={StaticResource CalendarResources}}"
                                    Style="{TemplateBinding ButtonStyle}" Foreground="{TemplateBinding MonthHeaderForeground}"/>
                            <Button Content="&#xe013;" x:Name="ButtonNext" HorizontalAlignment="Right" Visibility="Collapsed"
                                    AutomationProperties.HelpText="{Binding Next, Source={StaticResource CalendarResources}}"
                                    Style="{TemplateBinding ButtonStyle}" Foreground="{TemplateBinding MonthHeaderForeground}"/>
                        </Grid>
                        <Button x:Name="TodayButton" Content="{Binding Today, Source={StaticResource CalendarResources}}" Grid.Row="1" Style="{TemplateBinding TodayButtonStyle}"
                                Visibility="{Binding ShowTodayButton, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
