<?xml version="1.0" encoding="utf-8"?>
<UserControl mc:Ignorable="d" x:Class="C1Extended_Demo.CalendarBookBottom" 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" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">

    <UserControl.Resources>        
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="CalendarBookResources.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Style x:Key="TitleDayBkgStyle" TargetType="Border">
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FF245A76" Offset="0" />
                            <GradientStop Color="#FF6B91AA" Offset="0.583" />
                            <GradientStop Color="#FF759AB5" Offset="0.665" />
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness" Value="0,0,0,2" />
                <Setter Property="BorderBrush" Value="#FF6587A7" />
            </Style>
            
            <!-- Month Styles -->
            <Style x:Key="TitleDayStyle" TargetType="TextBlock">
                <Setter Property="Foreground" Value="White" />
                <Setter Property="FontSize" Value="12" />
                <Setter Property="FontWeight" Value="Bold" />
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Bottom" />
                <Setter Property="Margin" Value="0 18 0 5" />
                <Setter Property="FontFamily" Value="Times New Roman" />
            </Style>
            <Style x:Key="CalendarItemStyle" 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>
                                    <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">
                                                <Border Style="{StaticResource TitleDayBkgStyle}" CornerRadius="5,5,0,0">
                                                    <TextBlock Text="{Binding}" Style="{StaticResource TitleDayStyle}" />
                                                </Border>
                                            </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>
                                                </Grid>
                                            </ControlTemplate>
                                        </Grid.Resources>
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="40" />
                                                <RowDefinition Height="*" />
												<RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                            </Grid.RowDefinitions>
                                            <Border Style="{StaticResource TitleDayBkgStyle}" CornerRadius="5,5,0,0" />
                                            <Path Data="M426,164.00002 L493,164.00002 L493,177.93857 L493,188.09407 C493,190.25127 490.82635,192 488.14493,192 L486.20288,192 L475.52179,192 L426,192 L426,186.53189 z M142.00002,164.00002 L209.00002,164.00002 L209.00002,192 L142.00002,192 z M71,164.00002 L138,164.00002 L138,192 L71,192 z M0,164.00002 L67,164.00002 L67,171.68919 L67,185.75052 L67,187.3129 L67,188.09407 L67,192 L62.144928,192 L60.202881,192 L4.855072,192 C2.1737061,192 0,190.25127 0,188.09407 L0,187.3129 L0,185.75052 z M355,164 L422,164 L422,192 L355,192 z M284,164 L351,164 L351,192 L284,192 z M213.00002,164 L280,164 L280,192 L213.00002,192 z M426,132.00002 L493,132.00002 L493,160.00002 L426,160.00002 z M355,132.00002 L421.99997,132.00002 L421.99997,160.00002 L355,160.00002 z M284,132.00002 L351,132.00002 L351,160.00002 L284,160.00002 z M213.00002,132.00002 L280,132.00002 L280,160.00002 L213.00002,160.00002 z M142.00002,132.00002 L209.00002,132.00002 L209.00002,160.00002 L142.00002,160.00002 z M71,132.00002 L138,132.00002 L138,160.00002 L71,160.00002 z M0,132.00002 L67,132.00002 L67,160.00002 L0,160.00002 z M426,98.999992 L493,98.999992 L493,126.99999 L426,126.99999 z M355,98.999992 L421.99997,98.999992 L421.99997,126.99999 L355,126.99999 z M284,98.999992 L351,98.999992 L351,126.99999 L284,126.99999 z M213.00002,98.999992 L280,98.999992 L280,126.99999 L213.00002,126.99999 z M142.00002,98.999992 L209.00002,98.999992 L209.00002,126.99999 L142.00002,126.99999 z M71,98.999992 L138,98.999992 L138,126.99999 L71,126.99999 z M0,98.999992 L67,98.999992 L67,126.99999 L0,126.99999 z M426,66.000008 L493,66.000008 L493,94.000008 L426,94.000008 z M355,66.000008 L421.99997,66.000008 L421.99997,94.000008 L355,94.000008 z M284,66.000008 L351,66.000008 L351,94.000008 L284,94.000008 z M213.00002,66.000008 L280,66.000008 L280,94.000008 L213.00002,94.000008 z M142.00002,66.000008 L209.00002,66.000008 L209.00002,94.000008 L142.00002,94.000008 z M71,66.000008 L138,66.000008 L138,94.000008 L71,94.000008 z M0,66.000008 L67,66.000008 L67,94.000008 L0,94.000008 z M426,33.000004 L493,33.000004 L493,61.000004 L426,61.000004 z M355,33.000004 L421.99997,33.000004 L421.99997,61.000004 L355,61.000004 z M284,33.000004 L351,33.000004 L351,61.000004 L284,61.000004 z M213.00002,33.000004 L280,33.000004 L280,61.000004 L213.00002,61.000004 z M142.00002,33.000004 L209.00002,33.000004 L209.00002,61.000004 L142.00002,61.000004 z M71,33.000004 L138,33.000004 L138,61.000004 L71,61.000004 z M0,33.000004 L67,33.000004 L67,61.000004 L0,61.000004 z M426,0 L493,0 L493,28.000002 L426,28.000002 z M355,0 L421.99997,0 L421.99997,28.000002 L355,28.000002 z M284,0 L351,0 L351,28.000002 L284,28.000002 z M213.00002,0 L280,0 L280,28.000002 L213.00002,28.000002 z M142.00002,0 L209.00002,0 L209.00002,28.000002 L142.00002,28.000002 z M71,0 L138,0 L138,28.000002 L71,28.000002 z M0,0 L67,0 L67,28.000002 L0,28.000002 z" Fill="#FFD5E3EA" UseLayoutRounding="False" Grid.Row="1" Stretch="Fill" Margin="2" Grid.RowSpan="6" />
                                        </Grid>
                                        <Grid x:Name="MonthView">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="*" />
                                            </Grid.ColumnDefinitions>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="40" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="*" />
                                            </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>
                                <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="MonthCalendarStyle" TargetType="controls:Calendar">
                <Setter Property="IsTabStop" Value="False" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="controls:Calendar">
                            <Grid x:Name="Root">
                                <System_Windows_Controls_Primitives:CalendarItem x:Name="CalendarItem" Style="{StaticResource CalendarItemStyle}" />
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Border Background="White" CornerRadius="5" Width="400">
        <Grid x:Name="LayoutRoot">
            <Grid>
                <controls:Calendar x:Name="calendar" DisplayMode="Month" IsTodayHighlighted="True" Style="{StaticResource MonthCalendarStyle}" DisplayDateChanged="calendar_DisplayDateChanged" SelectedDatesChanged="calendar_SelectedDatesChanged" DisplayDate="{Binding Day}" />
                <Path Stretch="Fill" UseLayoutRounding="False" Data="M4.7479415,0 L495.21542,0 C498.09106,0.33296099 499.69119,1.9419931 500,4.842844 L500,61.752743 L493.36795,60.268562 C456.3688,52.313362 416.7272,48.000004 375.5,48.000008 C191.56329,48.000004 39.188137,133.8588 12.234431,245.94026 L11.340348,250 L4.5437288,250 C1.9792502,249.50926 0.470622,247.99745 0,245.4818 L0,4.791791 C0.41878578,1.9642336 1.9324206,0.29401842 4.7479415,0 z" RenderTransformOrigin="0.5,0.5" IsHitTestVisible="False">
                    <Path.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleY="-1" />
                            <SkewTransform AngleX="0" AngleY="0" />
                            <RotateTransform Angle="0" />
                            <TranslateTransform />
                        </TransformGroup>
                    </Path.RenderTransform>
                    <Path.Fill>
                        <LinearGradientBrush EndPoint="0.428,0.832" StartPoint="0.246,-0.03">
                            <GradientStop Color="#0CFFFFFF" Offset="0.337" />
                            <GradientStop Color="#4CFFFFFF" Offset="0.435" />
                        </LinearGradientBrush>
                    </Path.Fill>
                </Path>
            </Grid>

        	<Grid x:Name="SpiralBottom" VerticalAlignment="Top">
        		<Grid.RowDefinitions>
        			<RowDefinition Height="8" />
        			<RowDefinition Height="7" />
        			<RowDefinition Height="3" />
        		</Grid.RowDefinitions>
        		<Grid.ColumnDefinitions>
        							<ColumnDefinition Width="*" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="1" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="1" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="1" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="1" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="10*" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="1" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="1" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="1" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="1" />
				<ColumnDefinition Width="3" />
				<ColumnDefinition Width="2" />
				<ColumnDefinition Width="*" />
        		</Grid.ColumnDefinitions>
        		<Rectangle Style="{StaticResource SpiralHole}" Grid.ColumnSpan="5" Grid.RowSpan="2" Grid.Column="1" Grid.Row="1" />
        		<Rectangle Style="{StaticResource SpiralHole}" Grid.ColumnSpan="5" Grid.RowSpan="2" Grid.Column="7" Grid.Row="1" />
        		<Rectangle Style="{StaticResource SpiralHole}" Grid.ColumnSpan="5" Grid.RowSpan="2" Grid.Column="13" Grid.Row="1" />
        		<Rectangle Style="{StaticResource SpiralHole}" Grid.ColumnSpan="5" Grid.RowSpan="2" Grid.Column="19" Grid.Row="1" />
        		<Rectangle Style="{StaticResource SpiralHole}" Grid.RowSpan="2" Grid.Column="25" Grid.Row="1" Grid.ColumnSpan="5" />
        		<Rectangle Style="{StaticResource SpiralHole}" Grid.RowSpan="2" Grid.Column="31" Grid.Row="1" Grid.ColumnSpan="5" />
        		<Rectangle Style="{StaticResource SpiralHole}" Grid.RowSpan="2" Grid.Column="37" Grid.Row="1" Grid.ColumnSpan="5" />
        		<Rectangle Style="{StaticResource SpiralHole}" Grid.RowSpan="2" Grid.Column="43" Grid.Row="1" Grid.ColumnSpan="5" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.RowSpan="2" Grid.Column="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="4" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="8" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="10" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="14" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="16" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="20" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="22" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="26" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="28" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="32" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="34" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="38" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="40" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="44" Grid.RowSpan="2" />
        		<Border Style="{StaticResource SpiralBottom}" Grid.Column="46" Grid.RowSpan="2" />
        	</Grid>
        </Grid>
    </Border>
</UserControl>