<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="DefaultViews.MainPage" Loaded="UserControl_Loaded" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" FontFamily="Segoe UI" Background="#FF374F5D" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" 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">
    <UserControl.Resources>
        <!-- Border Brush -->
        <LinearGradientBrush x:Key="BorderBrush" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFA3AEB9" Offset="0" />
            <GradientStop Color="#FF8399A9" Offset="0.375" />
            <GradientStop Color="#FF718597" Offset="0.375" />
            <GradientStop Color="#FF617584" Offset="1" />
        </LinearGradientBrush>

        <!-- Button styles -->
        <SolidColorBrush x:Key="commandBaseBorderBrush" Color="#FF6593CF" />
        <LinearGradientBrush x:Key="buttBackBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FFE3EFFF" Offset="0" />
            <GradientStop Color="#FFC4DDFF" Offset="0.367" />
            <GradientStop Color="#FFADD1FF" Offset="0.377" />
            <GradientStop Color="#FFC0DBFF" Offset="1" />
        </LinearGradientBrush>
        <Style x:Key="buttonStyle" TargetType="Button">
            <Setter Property="Width" Value="90" />
            <Setter Property="Background" Value="{StaticResource buttBackBrush}" />
            <Setter Property="Foreground" Value="#FF000000" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="FontSize" Value="14" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[0].(GradientStop.Color)" To="#FFFFFCDE" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[1].(GradientStop.Color)" To="#FFFFEAAC" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[2].(GradientStop.Color)" To="#FFFFD767" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[3].(GradientStop.Color)" To="#FFFFE59B" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[0].(GradientStop.Color)" To="#FFFFFCDE" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[1].(GradientStop.Color)" To="#FFFFEAAC" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[2].(GradientStop.Color)" To="#FFFFD767" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[3].(GradientStop.Color)" To="Orange" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border BorderThickness="0,0,1,0">
                                <Border.Background>
                                    <LinearGradientBrush x:Name="BackgroundGradient" StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Color="#FFE3EFFF" Offset="0" />
                                        <GradientStop Color="#FFC4DDFF" Offset="0.367" />
                                        <GradientStop Color="#FFADD1FF" Offset="0.377" />
                                        <GradientStop Color="#FFC0DBFF" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Border Name="brd" BorderThickness="0,0,1,0" Margin="0,3" BorderBrush="{StaticResource commandBaseBorderBrush}" />
                            <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="RadioButton" x:Key="radioButtonStyle">
            <Setter Property="Width" Value="90" />
            <Setter Property="Background" Value="{StaticResource buttBackBrush}" />
            <Setter Property="Foreground" Value="#FF000000" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="FontSize" Value="14" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="RadioButton">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0" Storyboard.TargetName="brd" Storyboard.TargetProperty="Opacity" To="0.15" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="MouseOverGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[0].(GradientStop.Color)" To="#FFFFFCDE" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="MouseOverGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[1].(GradientStop.Color)" To="#FFFFEAAC" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="MouseOverGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[2].(GradientStop.Color)" To="#FFFFD767" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="MouseOverGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[3].(GradientStop.Color)" To="#FFFFE59B" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[0].(GradientStop.Color)" To="#FFFFD9AA" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[1].(GradientStop.Color)" To="#FFFFBB6E" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[2].(GradientStop.Color)" To="#FFFFAB3F" />
                                            <ColorAnimation Duration="0" Storyboard.TargetName="BackgroundGradient" Storyboard.TargetProperty="(GradientBrush.GradientStops)[3].(GradientStop.Color)" To="#FFFEE17A" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border BorderThickness="0,0,1,0">
                                <Border.Background>
                                    <LinearGradientBrush x:Name="MouseOverGradient" StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Color="Transparent" Offset="0" />
                                        <GradientStop Color="Transparent" Offset="0.367" />
                                        <GradientStop Color="Transparent" Offset="0.377" />
                                        <GradientStop Color="Transparent" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Border Name="brd" BorderThickness="0,0,1,0">
                                <Border.Background>
                                    <LinearGradientBrush x:Name="BackgroundGradient" StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Color="#FFE3EFFF" Offset="0" />
                                        <GradientStop Color="#F9C4DDFF" Offset="0.367" />
                                        <GradientStop Color="#E5ADD1FF" Offset="0.377" />
                                        <GradientStop Color="#C6C0DBFF" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Border BorderThickness="0,0,1,0" Margin="0,3" BorderBrush="{StaticResource commandBaseBorderBrush}" />
                            <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border BorderThickness="1" Height="28" HorizontalAlignment="Stretch" BorderBrush="{StaticResource BorderBrush}" Background="{StaticResource buttBackBrush}">
            <StackPanel Orientation="Horizontal">
                <Button x:Name="btnToday" Content="Today" Style="{StaticResource buttonStyle}" Click="btnToday_Click" />
                <Rectangle Width="0.5" Height="Auto" VerticalAlignment="Stretch" Margin="0,3" Fill="{StaticResource BorderBrush}" />
                <RadioButton x:Name="btnDay" Style="{StaticResource radioButtonStyle}" Content="Day" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" c1:CommandExtensions.Command="sched:C1Scheduler.ChangeStyleCommand" c1:CommandExtensions.CommandParameter="{Binding Path=OneDayStyle, ElementName=sched1}" />
                <RadioButton x:Name="btnWorkWeek" Style="{StaticResource radioButtonStyle}" Content="Work Week" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" c1:CommandExtensions.Command="sched:C1Scheduler.ChangeStyleCommand" c1:CommandExtensions.CommandParameter="{Binding Path=WorkingWeekStyle, ElementName=sched1}" />
                <RadioButton x:Name="btnWeek" Style="{StaticResource radioButtonStyle}" Content="Week" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" c1:CommandExtensions.Command="sched:C1Scheduler.ChangeStyleCommand" c1:CommandExtensions.CommandParameter="{Binding Path=WeekStyle, ElementName=sched1}" />
                <RadioButton x:Name="btnMonth" Style="{StaticResource radioButtonStyle}" Content="Month" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" c1:CommandExtensions.Command="sched:C1Scheduler.ChangeStyleCommand" c1:CommandExtensions.CommandParameter="{Binding Path=MonthStyle, ElementName=sched1}" />
                <RadioButton x:Name="btnTimeLine" Style="{StaticResource radioButtonStyle}" Content="Time Line" Width="100" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" c1:CommandExtensions.Command="sched:C1Scheduler.ChangeStyleCommand" c1:CommandExtensions.CommandParameter="{Binding Path=TimeLineStyle, ElementName=sched1}" />
                <Rectangle Width="0.5" Height="Auto" VerticalAlignment="Stretch" Margin="0,3" Fill="{StaticResource BorderBrush}" />
                <Button x:Name="btnImport" Content="Import..." ToolTipService.ToolTip="Load data from the local file." Style="{StaticResource buttonStyle}" c1:CommandExtensions.Command="sched:C1Scheduler.ImportCommand" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" />
                <Button x:Name="btnExport" Content="Export..." ToolTipService.ToolTip="Save data to the local file." Style="{StaticResource buttonStyle}" c1:CommandExtensions.Command="sched:C1Scheduler.ExportCommand" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" />
            </StackPanel>
        </Border>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="192" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <c1:C1Calendar x:Name="cal1" Grid.Column="0" Grid.Row="0" BorderBrush="{StaticResource BorderBrush}" CalendarHelper="{Binding CalendarHelper, ElementName=sched1, Mode=OneWay}" SelectedDates="{Binding VisibleDates, ElementName=sched1, Mode=OneWay}" BoldedDates="{Binding BoldedDates, ElementName=sched1, Mode=OneWay}" MaxSelectionCount="42" GenerateAdjacentMonthDays="True" />
            <c1:C1Scheduler x:Name="sched1" StyleChanged="sched1_StyleChanged" BorderThickness="1" Grid.Column="1" Grid.RowSpan="2" ShowWorkTimeOnly="True" Background="{Binding SelectedItem, ElementName=paletteBox}" BorderBrush="{StaticResource BorderBrush}" />
            <Border BorderBrush="{StaticResource BorderBrush}" Grid.Row="1" Background="#FFE7EFFF" Grid.Column="0" BorderThickness="1">
                <StackPanel>
                    <Rectangle Height="2" Margin="6,0,6,0" VerticalAlignment="Bottom" Grid.Row="3" StrokeThickness="0">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFC9DAEE" Offset="0.5" />
                                <GradientStop Color="White" Offset="0.5" />
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <StackPanel Orientation="Horizontal" Margin="7,10,8,10">
                        <TextBlock Foreground="Navy" Height="16" Width="76">Palette:</TextBlock>
                        <ComboBox x:Name="paletteBox" HorizontalAlignment="Stretch" ToolTipService.ToolTip="Change Scheduler's palette." Margin="1,0" HorizontalContentAlignment="Stretch" SelectedIndex="0" Height="20" Width="95">
                            <ComboBox.ItemContainerStyle>
                                <Style TargetType="ListBoxItem">
                                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                </Style>
                            </ComboBox.ItemContainerStyle>
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid HorizontalAlignment="Stretch">
                                        <Border BorderBrush="Black" Margin="1" BorderThickness="1" CornerRadius="2" Height="14" Background="{Binding}" VerticalAlignment="Center" />
                                    </Grid>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>

                            <SolidColorBrush Color="#FFC2D4EB" />
                            <!-- Outlook 2007 -->
                            <SolidColorBrush Color="#FFC9E1D1" />
                            <SolidColorBrush Color="#FFDCECC9" />
                            <SolidColorBrush Color="#FFDABAC6" />
                            <SolidColorBrush Color="#FFCFDAE8" />
                            <SolidColorBrush Color="#FFB3DCDC" />
                            <SolidColorBrush Color="#FFD6B3B3" />
                            <SolidColorBrush Color="#FFE4E4C8" />
                            <SolidColorBrush Color="#FFC4B7DE" />
                            <SolidColorBrush Color="#FFCEC0A5" />
                            <SolidColorBrush Color="#FFB1CDC3" />
                            <SolidColorBrush Color="#FF9CBFD0" />
                        </ComboBox>
                    </StackPanel>
                </StackPanel>
            </Border>
        </Grid>
    </Grid>
</UserControl>