<UserControl x:Class="CalendarControlLibrary.Controls.DayControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Controls="clr-namespace:CalendarControlLibrary.Controls" mc:Ignorable="d"
d:DesignHeight="150" d:DesignWidth="150">
<UserControl.Resources>
<!-- Colors -->
<Color x:Key="BlueGradientTop">#A5BFE1</Color>
<Color x:Key="BlueGradientBottom">#E6EDF7</Color>
<Color x:Key="GoldGradientTop">#FFB86D</Color>
<Color x:Key="GoldGradientBottom">#FFE876</Color>
<Color x:Key="LightBlueGradientTop">#FFFFFF</Color>
<Color x:Key="LightBlueGradientBottom">#AAE6EDF7</Color>
<Color x:Key="DarkBlueBorder">#8DAED9</Color>
<!-- Brushes -->
<LinearGradientBrush x:Key="HeaderBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="{StaticResource BlueGradientTop}" />
<GradientStop Offset="1" Color="{StaticResource BlueGradientBottom}" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="HeaderSelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="{StaticResource GoldGradientTop}" />
<GradientStop Offset="1" Color="{StaticResource GoldGradientBottom}" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="ContentBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="{StaticResource LightBlueGradientTop}" />
<GradientStop Offset="1" Color="{StaticResource LightBlueGradientBottom}" />
</LinearGradientBrush>
<LinearGradientBrush x:Key="ContentSelectedBackgroundBrush" StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="{StaticResource GoldGradientTop}" />
<GradientStop Offset="1" Color="{StaticResource GoldGradientBottom}" />
</LinearGradientBrush>
<SolidColorBrush x:Key="ControlBorderBrush" Color="{StaticResource DarkBlueBorder}" />
<SolidColorBrush x:Key="ControlSelectedBorderBrush" Color="{StaticResource GoldGradientBottom}" />
</UserControl.Resources>
<!-- The border around the Header and Listbox -->
<Border CornerRadius="2" BorderThickness="2">
<!-- The border style -->
<Border.Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="{DynamicResource ControlBorderBrush}" />
<Style.Triggers>
<Trigger Property="Controls:DayControl.IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource ControlSelectedBorderBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<!-- The Grid that contains the Header StackPanel and Content ListBox -->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- The Header StackPanel -->
<StackPanel x:Name="headerPanel" Grid.Row="0">
<TextBlock x:Name="dayLabel" Text="{Binding Path=DayNumber, UpdateSourceTrigger=PropertyChanged}" FontWeight="Bold"
Margin="3, 0, 0, 2"/>
<StackPanel.Style>
<Style TargetType="StackPanel">
<Setter Property="Background" Value="{DynamicResource HeaderBackgroundBrush}" />
<Style.Triggers>
<Trigger Property="Controls:DayControl.IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource HeaderSelectedBackgroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
</StackPanel>
<!-- The Content ListBox -->
<ListBox Grid.Row="1" x:Name="contentPanel">
<ListBox.Style>
<Style TargetType="ListBox">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="{DynamicResource ContentBackgroundBrush}" />
<Style.Triggers>
<Trigger Property="Controls:DayControl.IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ContentSelectedBackgroundBrush}" />
</Trigger>
</Style.Triggers>
</Style>
</ListBox.Style>
</ListBox>
</Grid>
</Border>
</UserControl>