<Window x:Class="CustomDialogs.MainWindow" Title="MainWindow" Height="640" Width="800" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:local="clr-namespace:CustomDialogs" 
        xmlns:c1sched="http://schemas.componentone.com/winfx/2006/xaml">
	<Window.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>
		<DataTemplate x:Key="customEditAppointmentTemplate">
			<local:EditAppointmentControl />
		</DataTemplate>
		<DataTemplate x:Key="customSelectFromListSceneTemplate">
			<local:SelectFromListScene />
		</DataTemplate>
		<DataTemplate x:Key="customShowRemindersTemplate">
			<local:ShowRemindersControl />
		</DataTemplate>
		<DataTemplate x:Key="customEditRecurrenceTemplate">
			<local:EditRecurrenceControl />
		</DataTemplate>
		</Window.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" CommandTarget="{Binding ElementName=sched1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=OneDayStyle, ElementName=sched1}" />
					<RadioButton x:Name="btnWorkWeek" Style="{StaticResource radioButtonStyle}" Content="Work Week" CommandTarget="{Binding ElementName=sched1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=WorkingWeekStyle, ElementName=sched1}" />
					<RadioButton x:Name="btnWeek" Style="{StaticResource radioButtonStyle}" Content="Week" CommandTarget="{Binding ElementName=sched1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=WeekStyle, ElementName=sched1}" />
					<RadioButton x:Name="btnMonth" Style="{StaticResource radioButtonStyle}" Content="Month" CommandTarget="{Binding ElementName=sched1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" CommandParameter="{Binding Path=MonthStyle, ElementName=sched1}" />
                    <RadioButton x:Name="btnTimeLine" Style="{StaticResource radioButtonStyle}" Content="Time Line" CommandTarget="{Binding ElementName=sched1}" Command="c1sched:C1Scheduler.ChangeStyleCommand" 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}" Command="c1sched:C1Scheduler.ImportCommand" CommandTarget="{Binding ElementName=sched1}" />
					<Button x:Name="btnExport" Content="Export..." ToolTipService.ToolTip="Save data to the local file." Style="{StaticResource buttonStyle}" Command="c1sched:C1Scheduler.ExportCommand" CommandTarget="{Binding ElementName=sched1}" />
				</StackPanel>
			</Border>
			<c1sched:C1Scheduler x:Name="sched1" Margin="0 -1 0 0" StyleChanged="sched1_StyleChanged" BorderThickness="1" Grid.Row="1" BorderBrush="{StaticResource BorderBrush}" EditAppointmentTemplate="{StaticResource customEditAppointmentTemplate}" SelectFromListTemplate="{StaticResource customSelectFromListSceneTemplate}" ShowRemindersTemplate="{StaticResource customShowRemindersTemplate}" EditRecurrenceTemplate="{StaticResource customEditRecurrenceTemplate}" />
		</Grid>
</Window>