<UserControl x:Class="ControlExplorer.Controls.Calendar.DaySlotTemplateSelector"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:c1calendar="using:C1.Xaml.Calendar"
    xmlns:local="using:ControlExplorer.Controls.Calendar"
    d:DesignHeight="480" d:DesignWidth="480">
    
    <UserControl.Resources>
        <local:DayTemplateSelector x:Key="DaySlotTemplateSelector">
            <local:DayTemplateSelector.Resources>
                <ResourceDictionary>
                    <DataTemplate x:Key="BoldedDay">
                        <Grid>
                            <!-- show appointments information saved in the DaySlot.DataSource property -->
                            <Border Background="#FF91B035" Grid.Row="0" VerticalAlignment="Top" BorderThickness="2 0 0 0" BorderBrush="#FFBCD472">
                                <TextBlock Text="{Binding Path=DataSource[0].Value}" Margin="2" TextWrapping="Wrap" Foreground="White" />
                            </Border>
                            <Border Background="#8880A0BB" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="23" Width="23" >
                                <TextBlock Text="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                            </Border>
                        </Grid>
                    </DataTemplate>
                    <DataTemplate x:Key="UnboldedDay">
                        <TextBlock Text="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="6,0,0,4"/>
                    </DataTemplate>
                    <DataTemplate x:Key="TodayBoldedDay">
                        <Border BorderBrush="{Binding Path=Calendar.TodayBrush}" BorderThickness="2" CornerRadius="6">
                            <Grid>
                                <!-- show appointments information saved in the DaySlot.DataSource property -->
                                <Border Background="#FF91B035" Grid.Row="0" VerticalAlignment="Top" BorderThickness="2 0 0 0" BorderBrush="#FFBCD472">
                                    <TextBlock Text="{Binding Path=DataSource[0].Value}" Margin="2" TextWrapping="Wrap" Foreground="White" />
                                </Border>
                                <Border Background="#8880A0BB" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="23" Width="23" >
                                    <TextBlock Text="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                </Border>
                            </Grid>
                        </Border>
                    </DataTemplate>
                    <DataTemplate x:Key="TodayUnboldedDay">
                        <Border BorderBrush="{Binding Path=Calendar.TodayBrush}" BorderThickness="2" CornerRadius="6">
                            <TextBlock Text="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="6,0,0,4"/>
                        </Border>
                    </DataTemplate>
                    <DataTemplate x:Key="Holiday">
                        <!-- show holiday information saved in the DaySlot.Tag property (it's Holiday structure)-->
                        <Grid Background="{Binding Path=Tag.Background}">
                            <TextBlock Text="{Binding Path=Tag.Text}" Margin="2" TextWrapping="Wrap" Foreground="{Binding Path=Tag.Foreground}" />
                            <Border Background="#22FF0000" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="23" Width="23" >
                                <TextBlock Text="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{Binding Path=Tag.Foreground}"/>
                            </Border>
                        </Grid>
                    </DataTemplate>
                </ResourceDictionary>
            </local:DayTemplateSelector.Resources>
        </local:DayTemplateSelector>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <c1calendar:C1Calendar x:Name="calendar" MaxSelectionCount="14" WeekendBrush="Red" TodayBrush="Orange" FontSize="16"/>
    </Grid>
</UserControl>
