<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:System_Windows_Controls_Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls">
    
    <Style x:Key="CalenderNavButtonDisabled"
           TargetType="System_Windows_Controls_Primitives:CalendarItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="System_Windows_Controls_Primitives:CalendarItem">
                    <Grid>
                        <Grid.Resources>
                            <SolidColorBrush x:Key="DisabledBrush"
                                             Color="#8CFFFFFF" />
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="DisabledVisual"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Margin="0,2,0,2"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="1">
                            <Border BorderBrush="#FFFFFFFF"
                                    BorderThickness="2"
                                    CornerRadius="1">
                                <Grid>
                                    <Grid.Resources>
                                        <ControlTemplate x:Key="HeaderButtonTemplate"
                                                         TargetType="Button">
                                            <Grid Cursor="Hand">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation Duration="0"
                                                                                Storyboard.TargetName="ContentBrush"
                                                                                Storyboard.TargetProperty="Color"
                                                                                To="#FF73A9D8" />
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <DoubleAnimation Duration="0"
                                                                                 Storyboard.TargetName="Content"
                                                                                 Storyboard.TargetProperty="Opacity"
                                                                                 To=".5" />
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <ContentControl x:Name="Content"
                                                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                Margin="1,5,1,9"
                                                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                                IsTabStop="False"
                                                                Content="{TemplateBinding Content}"
                                                                ContentTemplate="{TemplateBinding ContentTemplate}">
                                                    <ContentControl.Foreground>
                                                        <SolidColorBrush x:Name="ContentBrush"
                                                                         Color="#FF333333" />
                                                    </ContentControl.Foreground>
                                                </ContentControl>
                                            </Grid>
                                        </ControlTemplate>
                                        <DataTemplate x:Name="DayTitleTemplate">
                                            <TextBlock HorizontalAlignment="Center"
                                                       Margin="0,4,0,4"
                                                       VerticalAlignment="Center"
                                                       FontSize="9.5"
                                                       FontWeight="Bold"
                                                       Text="{Binding}" />
                                        </DataTemplate>
                                        <ControlTemplate x:Key="PreviousButtonTemplate"
                                                         TargetType="Button">
                                            <Grid Cursor="Hand">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation Duration="0"
                                                                                Storyboard.TargetName="IconBrush"
                                                                                Storyboard.TargetProperty="Color"
                                                                                To="#FF73A9D8" />
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <DoubleAnimation Duration="0"
                                                                                 Storyboard.TargetName="IconBrush"
                                                                                 Storyboard.TargetProperty="Opacity"
                                                                                 To=".5" />
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Rectangle Fill="#11E5EBF1"
                                                           Stretch="Fill"
                                                           Opacity="1" />
                                                <Grid>
                                                    <Path Stretch="Fill"
                                                          Height="10"
                                                          HorizontalAlignment="Left"
                                                          Margin="14,-6,0,0"
                                                          VerticalAlignment="Center"
                                                          Width="6"
                                                          Data="M288.75,232.25 L288.75,240.625 L283,236.625 z">
                                                        <Path.Fill>
                                                            <SolidColorBrush x:Name="IconBrush"
                                                                             Color="#FF333333" />
                                                        </Path.Fill>
                                                    </Path>
                                                </Grid>
                                            </Grid>
                                        </ControlTemplate>
                                        <ControlTemplate x:Key="NextButtonTemplate"
                                                         TargetType="Button">
                                            <Grid Cursor="Hand">
                                                <VisualStateManager.VisualStateGroups>
                                                    <VisualStateGroup x:Name="CommonStates">
                                                        <VisualState x:Name="Normal" />
                                                        <VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimation Duration="0"
                                                                                Storyboard.TargetName="IconBrush"
                                                                                Storyboard.TargetProperty="Color"
                                                                                To="#FF73A9D8" />
                                                            </Storyboard>
                                                        </VisualState>
                                                        <VisualState x:Name="Disabled">
                                                            <Storyboard>
                                                                <DoubleAnimation Duration="0"
                                                                                 Storyboard.TargetName="IconBrush"
                                                                                 Storyboard.TargetProperty="Opacity"
                                                                                 To=".5" />
                                                            </Storyboard>
                                                        </VisualState>
                                                    </VisualStateGroup>
                                                </VisualStateManager.VisualStateGroups>
                                                <Rectangle Fill="#11E5EBF1"
                                                           Stretch="Fill"
                                                           Opacity="1" />
                                                <Grid>
                                                    <Path Stretch="Fill"
                                                          Height="10"
                                                          HorizontalAlignment="Right"
                                                          Margin="0,-6,14,0"
                                                          VerticalAlignment="Center"
                                                          Width="6"
                                                          Data="M282.875,231.875 L282.875,240.375 L288.625,236 z">
                                                        <Path.Fill>
                                                            <SolidColorBrush x:Name="IconBrush"
                                                                             Color="#FF333333" />
                                                        </Path.Fill>
                                                    </Path>
                                                </Grid>
                                            </Grid>
                                        </ControlTemplate>
                                    </Grid.Resources>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <Button x:Name="PreviousButton"
                                            Height="0"
                                            HorizontalAlignment="Left"
                                            Width="0"
                                            Visibility="Collapsed"
                                            Template="{StaticResource PreviousButtonTemplate}" />
                                    <Grid Grid.Column="1"
                                          HorizontalAlignment="Center"
                                          VerticalAlignment="Center">
                                        <Button x:Name="HeaderButton"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                FontSize="10.5"
                                                FontWeight="Bold"
                                                Template="{StaticResource HeaderButtonTemplate}"
                                                IsEnabled="False" />
                                    </Grid>
                                    <Button x:Name="NextButton"
                                            Height="0"
                                            HorizontalAlignment="Right"
                                            Width="0"
                                            Visibility="Collapsed"
                                            Template="{StaticResource NextButtonTemplate}"
                                            Grid.Column="2" />
                                    <Grid x:Name="MonthView"
                                          Margin="6,-1,6,6"
                                          Visibility="Collapsed"
                                          Grid.ColumnSpan="3"
                                          Grid.Row="1">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                    </Grid>
                                    <Grid x:Name="YearView"
                                          Margin="6,-3,7,6"
                                          Visibility="Collapsed"
                                          Grid.ColumnSpan="3"
                                          Grid.Row="1">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                            <ColumnDefinition Width="Auto" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                            <RowDefinition Height="Auto" />
                                        </Grid.RowDefinitions>
                                    </Grid>
                                </Grid>
                            </Border>
                        </Border>
                        <Rectangle x:Name="DisabledVisual"
                                   Fill="{StaticResource DisabledBrush}"
                                   Stretch="Fill"
                                   Stroke="{StaticResource DisabledBrush}"
                                   StrokeThickness="1"
                                   RadiusX="2"
                                   RadiusY="2"
                                   Margin="0,2,0,2"
                                   Opacity="0"
                                   Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CustomNextButtonTemplete"
           TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid Cursor="Hand">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="IconBrush"
                                                        Storyboard.TargetProperty="Color"
                                                        To="#FF73A9D8" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         Storyboard.TargetName="IconBrush"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To=".5" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="#11E5EBF1"
                                   Stretch="Fill"
                                   Opacity="1" />
                        <Grid>
                            <Path Stretch="Fill"
                                  Height="10"
                                  HorizontalAlignment="Right"
                                  Margin="0,-6,14,0"
                                  VerticalAlignment="Center"
                                  Width="6"
                                  Data="M282.875,231.875 L282.875,240.375 L288.625,236 z">
                                <Path.Fill>
                                    <SolidColorBrush x:Name="IconBrush"
                                                     Color="#FF333333" />
                                </Path.Fill>
                            </Path>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="CustomPrevButtonTemplete"
           TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid Cursor="Hand">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        To="#FF73A9D8"
                                                        Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="IconPath" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To=".5"
                                                         Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Opacity)"
                                                         Storyboard.TargetName="IconPath" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="#11E5EBF1"
                                   Opacity="1"
                                   Stretch="Fill" />
                        <Grid>
                            <Path x:Name="IconPath"
                                  Data="M288.75,232.25 L288.75,240.625 L283,236.625 z"
                                  Fill="#FF333333"
                                  HorizontalAlignment="Left"
                                  Height="10"
                                  Margin="14,-6,0,0"
                                  Stretch="Fill"
                                  VerticalAlignment="Center"
                                  Width="6" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
