<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4" 
                    xmlns:c1sched="clr-namespace:C1.WPF.Schedule;assembly=C1.WPF.Schedule.4" 
                    xmlns:sys="clr-namespace:System;assembly=mscorlib" 
                    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.Schedule.4;component/themes/generic.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <SolidColorBrush x:Key="C1Calendar_Border_Brush" Color="#000B0B0B" PresentationOptions:Freeze="true" />

    <!-- Font settings -->
    <FontFamily x:Key="C1Calendar_Font">Arial</FontFamily>
    <sys:Double x:Key="C1Calendar_FontSize">11</sys:Double>
    <SolidColorBrush x:Key="C1Calendar_Foreground_Brush" Color="White" PresentationOptions:Freeze="true" />
    <SolidColorBrush x:Key="C1Calendar_Background" Color="Black" PresentationOptions:Freeze="true" />

    <!-- Month Header resources -->
    <FontFamily x:Key="C1Calendar_MonthHeader_Font">Arial</FontFamily>
    <sys:Double x:Key="C1Calendar_MonthHeader_FontSize">13</sys:Double>
    <LinearGradientBrush x:Key="C1Calendar_MonthHeader_Brush" EndPoint="0.5,0.005" StartPoint="0.5,0.967" PresentationOptions:Freeze="true">
        <GradientStop Color="#FF5D5D5D" Offset="0" />
        <GradientStop Color="#FFA7A7A7" Offset="1" />
    </LinearGradientBrush>
    <SolidColorBrush x:Key="C1Calendar_MonthHeaderText_Brush" Color="Black" PresentationOptions:Freeze="true" />
    <FontWeight x:Key="C1Calendar_MonthHeader_FontWeight">Bold</FontWeight>
    <SolidColorBrush x:Key="C1Calendar_MonthHeader_MouseOverBrush" Color="LightGray" PresentationOptions:Freeze="true" />
    <SolidColorBrush x:Key="C1Calendar_NavArrow_Brush" Color="Black" PresentationOptions:Freeze="true" />

    <!-- Calendar days -->
    <LinearGradientBrush x:Key="C1Calendar_Today_Brush" EndPoint="0.5,0.005" StartPoint="0.5,0.967" PresentationOptions:Freeze="true">
        <GradientStop Color="#FF077BC7" Offset="0" />
        <GradientStop Color="#FFCDE9FC" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="C1Calendar_SelectedDate_Brush" EndPoint="0.5,0.005" StartPoint="0.5,0.967" PresentationOptions:Freeze="true">
        <GradientStop Color="#FFB63B00" Offset="0" />
        <GradientStop Color="#FFFBC636" Offset="1" />
    </LinearGradientBrush>
    <SolidColorBrush x:Key="C1Calendar_AdjucentDateText_Brush" Color="#FFCFCDCD" PresentationOptions:Freeze="true" />
    <SolidColorBrush x:Key="C1Calendar_Weekend_Brush" Color="White" PresentationOptions:Freeze="true" />

    <!-- additional resources -->

    <LinearGradientBrush x:Key="calendarBackground" EndPoint="0.5,0.005" StartPoint="0.5,0.967" PresentationOptions:Freeze="true">
        <GradientStop Color="#FF2F2F2F" Offset="0" />
        <GradientStop Color="#FF434343" Offset="1" />
    </LinearGradientBrush>

    <Style TargetType="{x:Type c1sched:C1CalendarItem}">
        <Style.Resources>
            <ControlTemplate x:Key="looklessButton" TargetType="{x:Type ToggleButton}">
                <Border>
                    <ContentPresenter />
                </Border>
            </ControlTemplate>
            <Style TargetType="{x:Type RepeatButton}" x:Key="NavigationButtonStyle">
                <Setter Property="Focusable" Value="False" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="Margin" Value="7,2,7,2" />
            </Style>
            <Style x:Key="listSelectionCombo" TargetType="{x:Type ComboBox}">
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="Margin" Value="2" />
                <Setter Property="Padding" Value="1" />
                <Setter Property="Focusable" Value="False" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="VerticalContentAlignment" Value="Center" />
                <Setter Property="HorizontalContentAlignment" Value="Center" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ComboBox}">
                            <Border Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" x:Name="brd" KeyboardNavigation.DirectionalNavigation="None" KeyboardNavigation.TabNavigation="None" SnapsToDevicePixels="true">
                                <Grid>
                                    <Popup AllowsTransparency="true" Name="PART_Popup" Placement="Center" PlacementTarget="{Binding ElementName=SelectedItemBorder}" IsOpen="{TemplateBinding IsDropDownOpen}" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}">
                                        <Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderThickness="1" TextBlock.Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}">
                                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                        </Border>
                                    </Popup>
                                    <ToggleButton x:Name="SelectedItemBorder" Margin="{TemplateBinding Padding}" Focusable="false" Background="Transparent" IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Release" Foreground="{TemplateBinding Foreground}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Template="{StaticResource looklessButton}">
                                        <ContentPresenter Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                    </ToggleButton>
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter TargetName="SelectedItemBorder" Property="Foreground" Value="{DynamicResource C1Calendar_MonthHeader_MouseOverBrush}" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="ItemContainerStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="Focusable" Value="False" />
                        </Style>
                    </Setter.Value>
                </Setter>
            </Style>
        </Style.Resources>
        <Setter Property="Height" Value="180" />
        <Setter Property="Width" Value="180" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="DaysOfWeekPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <UniformGrid Columns="7" Rows="1" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="DaysPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <UniformGrid Columns="7" Rows="6">
                        <UniformGrid.InputBindings>
                            <KeyBinding Key="Home" Command="ComponentCommands.MoveToHome" />
                            <KeyBinding Key="Left" Command="ComponentCommands.MoveLeft" CommandParameter="-1" />
                            <KeyBinding Key="Right" Command="ComponentCommands.MoveRight" CommandParameter="1" />
                            <KeyBinding Key="Down" Command="ComponentCommands.MoveDown" CommandParameter="7" />
                            <KeyBinding Key="Up" Command="ComponentCommands.MoveUp" CommandParameter="-7" />
                            <KeyBinding Key="Left" Modifiers="Shift" Command="ComponentCommands.ExtendSelectionLeft" CommandParameter="-1" />
                            <KeyBinding Key="Right" Modifiers="Shift" Command="ComponentCommands.ExtendSelectionRight" CommandParameter="1" />
                            <KeyBinding Key="Down" Modifiers="Shift" Command="ComponentCommands.ExtendSelectionDown" CommandParameter="7" />
                            <KeyBinding Key="Up" Modifiers="Shift" Command="ComponentCommands.ExtendSelectionUp" CommandParameter="-7" />
                        </UniformGrid.InputBindings>
                    </UniformGrid>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid Margin="{TemplateBinding Margin}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Border Grid.Row="0" Grid.RowSpan="3" Grid.ColumnSpan="2" CornerRadius="8" Background="{StaticResource calendarBackground}" />
                        <Rectangle Grid.Row="0" Grid.ColumnSpan="2" RadiusX="7" RadiusY="7" Margin="1,4,1,0" Fill="#28000000" />
                        <Rectangle Grid.Row="0" Grid.ColumnSpan="2" RadiusX="7" RadiusY="7" Margin="2" Fill="{Binding Path=C1Calendar.MonthHeaderBackground}" />

                        <DockPanel VerticalAlignment="Center" Margin="1" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
                            <RepeatButton Name="prevMonth" DockPanel.Dock="Left" Visibility="{Binding ShowPreviousButton, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" Command="c1sched:C1Calendar.PreviousMonthCommand" Foreground="{Binding Path=C1Calendar.NavigationButtonBrush}" Style="{StaticResource NavigationButtonStyle}">
                                <RepeatButton.Template>
                                    <ControlTemplate>
                                        <Border Padding="{TemplateBinding Margin}" Background="Transparent">
                                            <Polygon x:Name="pol" Points="6,0 0,5 6,10" Fill="{TemplateBinding Foreground}" />
                                        </Border>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter TargetName="pol" Property="Fill" Value="{DynamicResource C1Calendar_MonthHeader_MouseOverBrush}" />
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </RepeatButton.Template>
                            </RepeatButton>
                            <RepeatButton Name="nextMonth" DockPanel.Dock="Right" Visibility="{Binding ShowNextButton, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" Command="c1sched:C1Calendar.NextMonthCommand" Foreground="{Binding Path=C1Calendar.NavigationButtonBrush}" Style="{StaticResource NavigationButtonStyle}">
                                <RepeatButton.Template>
                                    <ControlTemplate>
                                        <Border Padding="{TemplateBinding Margin}" Background="Transparent">
                                            <Polygon x:Name="pol" Points="0,0 6,5 0,10" Fill="{TemplateBinding Foreground}" />
                                        </Border>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter TargetName="pol" Property="Fill" Value="{DynamicResource C1Calendar_MonthHeader_MouseOverBrush}" />
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </RepeatButton.Template>
                            </RepeatButton>
                            <StackPanel Name="inMmcRoot" Orientation="Horizontal" TextBlock.FontFamily="{Binding Path=C1Calendar.MonthHeaderFontFamily}" TextBlock.FontSize="{Binding Path=C1Calendar.MonthHeaderFontSize}" TextBlock.FontWeight="{Binding Path=C1Calendar.MonthHeaderFontWeight}" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <ComboBox x:Name="PART_MonthsComboBox" Style="{StaticResource listSelectionCombo}" HorizontalAlignment="Right" Foreground="{Binding Path=C1Calendar.MonthHeaderForeground}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate DataType="{x:Type c1sched:DateTimeInfo}">
                                            <TextBlock Text="{Binding Path=MonthFullName}" />
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                                <ComboBox x:Name="PART_YearsComboBox" Style="{StaticResource listSelectionCombo}" HorizontalAlignment="Left" Foreground="{Binding Path=C1Calendar.MonthHeaderForeground}">
                                    <ComboBox.ItemTemplate>
                                        <DataTemplate DataType="{x:Type c1sched:DateTimeInfo}">
                                            <TextBlock Text="{Binding Path=Year}" />
                                        </DataTemplate>
                                    </ComboBox.ItemTemplate>
                                </ComboBox>
                            </StackPanel>
                        </DockPanel>

                        <c1sched:DaysOfWeekPresenter Grid.Row="1" Grid.Column="1" />
                        <c1sched:WeekNumbersPresenter Grid.Row="2" Margin="5,0,0,0" Grid.Column="0" FontSize="8" Foreground="{DynamicResource C1Calendar_AdjucentDateText_Brush}" Visibility="{Binding Path=C1Calendar.ShowWeekNumbers,                                      Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" />
                        <c1sched:C1CalendarItemPresenter Grid.Row="2" Grid.Column="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="DayOfWeekSlotTemplate">
            <Setter.Value>
                <DataTemplate>
                    <TextBlock x:Name="DaySlotText" Text="{Binding Path=DayShortestName}" FontWeight="Medium" Padding="2" HorizontalAlignment="Center" VerticalAlignment="Center" />
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=IsWeekend}" Value="True">
                            <Setter TargetName="DaySlotText" Property="Foreground" Value="{Binding Path=Owner.C1Calendar.WeekendBrush}" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="DaySlotTemplate">
            <Setter.Value>
                <DataTemplate>
                    <c1sched:PilePanel>
                        <Rectangle x:Name="selection" Margin="0,1,0,1" Fill="Transparent" />
                        <Border x:Name="DaySlot" CornerRadius="4" Margin="1,2,1,2">
                            <TextBlock x:Name="DaySlotText" Margin="2" Text="{Binding Path=Date.Day}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Border>
                    </c1sched:PilePanel>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=IsWeekend}" Value="True">
                            <Setter TargetName="DaySlotText" Property="Foreground" Value="{Binding Path=Owner.C1Calendar.WeekendBrush}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=IsToday}" Value="True">
                            <Setter TargetName="DaySlot" Property="Background" Value="{Binding Path=Owner.C1Calendar.TodayBrush}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=IsSelected}" Value="True">
                            <Setter TargetName="selection" Property="Fill" Value="{Binding Path=Owner.C1Calendar.SelectedDayBrush}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=IsBolded}" Value="True">
                            <Setter TargetName="DaySlotText" Property="FontWeight" Value="Bold" />
                            <Setter TargetName="DaySlotText" Property="FontSize" Value="12" />
                        </DataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=Empty}" Value="false" />
                                <Condition Binding="{Binding Path=IsAdjacent}" Value="true" />
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="DaySlotText" Property="Foreground" Value="{Binding Path=Owner.C1Calendar.AdjacentMonthDayBrush}" />
                        </MultiDataTrigger>
                        <DataTrigger Binding="{Binding Path=IsEnabled}" Value="False">
                            <Setter TargetName="DaySlotText" Property="Foreground" Value="{Binding Path=Owner.C1Calendar.DisabledDayBrush}" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Defines a thickness of an outer show time border of an appointment in interval. -->
    <Thickness x:Key="C1Scheduler_AllDayAreaBorder_Thickness">3,1,3,3</Thickness>
    <SolidColorBrush x:Key="C1Scheduler_AlternateMonthDay_Brush" Color="#08FFFFFF" />
    <SolidColorBrush x:Key="C1Scheduler_AllDayArea_Brush" Color="#11FFFFFF" />
    <SolidColorBrush x:Key="C1Scheduler_AllDayArea_SelectedBrush" Color="#66666666" />

    <Color x:Key="C1Scheduler_BaseBackgroundColor">#FF111111</Color>

    <!-- @ Base Colors used in Scheduler -->
    <Color x:Key="C1Scheduler_BaseColor">#000B0B0B</Color>

    <Style x:Key="C1Scheduler_ControlAreaDark_BrushStyle" TargetType="c1:C1BrushBuilder">
        <Setter Property="DesignColor" Value="{StaticResource C1Scheduler_BaseBackgroundColor}" />
        <Setter Property="DesignBrush" Value="Black" />
    </Style>

    <SolidColorBrush x:Key="C1Scheduler_Background" Color="{StaticResource C1Scheduler_BaseBackgroundColor}" />
    <SolidColorBrush x:Key="C1Scheduler_Border_Brush" Color="{StaticResource C1Scheduler_BaseColor}" />
    <SolidColorBrush x:Key="C1Scheduler_Foreground_Brush" Color="#FF000000" />


    <LinearGradientBrush x:Key="C1Scheduler_WorkHour_Brush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#3FFFFFFF" Offset="0" />
        <GradientStop Color="#24FFFFFF" Offset="1" />
    </LinearGradientBrush>
    <SolidColorBrush x:Key="C1Scheduler_WorkHourBorder_Brush" Color="#4DFFFFFF" />
    <SolidColorBrush x:Key="C1Scheduler_WorkHourLightBorder_Brush" Color="#33FFFFFF" />
    <SolidColorBrush x:Key="C1Scheduler_FreeHour_Brush" Color="#19FFFFFF" />
    <SolidColorBrush x:Key="C1Scheduler_FreeHourBorder_Brush" Color="#4BFFFFFF" />
    <SolidColorBrush x:Key="C1Scheduler_FreeHourLightBorder_Brush" Color="#34FFFFFF" />
    <SolidColorBrush x:Key="C1Scheduler_Day_SelectedBrush" Color="#64000000" />
    <SolidColorBrush x:Key="C1Scheduler_TimeSlot_SelectedBrush" Color="#7F000000" />
    <SolidColorBrush x:Key="C1Scheduler_ControlArea_Brush" Color="#FF111111" />
    <SolidColorBrush x:Key="C1Scheduler_ControlAreaText_Brush" Color="#FFFFFFFF" />
    <!-- C1BrushBuilder style which is used for coloring month header. -->
    <Style x:Key="C1Scheduler_MonthHeaderForeground_BrushStyle" TargetType="c1:C1BrushBuilder">
        <Setter Property="DesignColor" Value="{StaticResource C1Scheduler_BaseBackgroundColor}" />
        <Setter Property="DesignBrush" Value="{StaticResource C1Scheduler_ControlAreaText_Brush}" />
    </Style>

    <LinearGradientBrush x:Key="brush1" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFA7A7A7" Offset="0" />
        <GradientStop Color="#FF5D5D5D" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="brush2" EndPoint="1,0" StartPoint="0,0">
        <GradientStop Color="#00FFFFFF" Offset="0" />
        <GradientStop Color="#3FBABABA" Offset="0.5" />
        <GradientStop Color="#00FFFFFF" Offset="1" />
    </LinearGradientBrush>

    <VisualBrush x:Key="C1Scheduler_DayHeader_Brush" RenderOptions.CachingHint="Cache">
        <VisualBrush.Visual>
            <c1sched:PilePanel>
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush1}" />
                <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z" Fill="{StaticResource brush2}" />
            </c1sched:PilePanel>
        </VisualBrush.Visual>
    </VisualBrush>

    <LinearGradientBrush x:Key="brush3" EndPoint="1,0" StartPoint="0,0">
        <GradientStop Color="#00FFFFFF" Offset="0" />
        <GradientStop Color="#7EBABABA" Offset="0.5" />
        <GradientStop Color="#00FFFFFF" Offset="1" />
    </LinearGradientBrush>
    <RadialGradientBrush x:Key="brush4">
        <RadialGradientBrush.RelativeTransform>
            <TransformGroup>
                <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1" ScaleY="1.722" />
                <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                <TranslateTransform X="0" Y="0.522" />
            </TransformGroup>
        </RadialGradientBrush.RelativeTransform>
        <GradientStop Color="#BFF4F4F4" Offset="0" />
        <GradientStop Color="#00FFFFFF" Offset="1" />
    </RadialGradientBrush>
    <VisualBrush x:Key="C1Scheduler_DayHeader_HoverBrush" RenderOptions.CachingHint="Cache">
        <VisualBrush.Visual>
            <c1sched:PilePanel>
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush1}" />
                <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z" Fill="{StaticResource brush3}" />
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush4}" />
            </c1sched:PilePanel>
        </VisualBrush.Visual>
    </VisualBrush>

    <SolidColorBrush x:Key="C1Scheduler_DayHeaderBorder_Brush" Color="#00000000" />

    <VisualBrush x:Key="C1Scheduler_WeekTab_HoverBrush" RenderOptions.CachingHint="Cache">
        <VisualBrush.Visual>
            <c1sched:PilePanel>
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush1}" />
                <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z" Fill="{StaticResource brush3}" />
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush4}" />
            </c1sched:PilePanel>
        </VisualBrush.Visual>
    </VisualBrush>
    <VisualBrush x:Key="C1Scheduler_WeekTab_Brush" RenderOptions.CachingHint="Cache">
        <VisualBrush.Visual>
            <c1sched:PilePanel>
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush1}" />
                <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z" Fill="{StaticResource brush2}" />
            </c1sched:PilePanel>
        </VisualBrush.Visual>
    </VisualBrush>

    <LinearGradientBrush x:Key="C1Scheduler_AppointmentBgMask_Brush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#AAFFFFFF" Offset="0" />
        <GradientStop Color="#20FFFFFF" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="MouseOverGradientBorderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="LightGray" Offset="0.05" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="MouseOverGradientBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#80FFFFFF" Offset="0.5" />
        <GradientStop Color="#00FFFFFF" Offset="1" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="SelectedAppointmentBorderBrush" Color="White" />

    <LinearGradientBrush x:Key="brush5" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FF5DE5FD" Offset="0" />
        <GradientStop Color="#FF0064C7" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="brush6" EndPoint="1,0" StartPoint="0,0">
        <GradientStop Color="#00FFFFFF" Offset="0" />
        <GradientStop Color="#5E7BE3F6" Offset="0.5" />
        <GradientStop Color="#00FFFFFF" Offset="1" />
    </LinearGradientBrush>
    <RadialGradientBrush x:Key="brush7">
        <RadialGradientBrush.RelativeTransform>
            <TransformGroup>
                <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1" ScaleY="1.722" />
                <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                <TranslateTransform X="0" Y="0.522" />
            </TransformGroup>
        </RadialGradientBrush.RelativeTransform>
        <GradientStop Color="#FF5DE5FD" Offset="0" />
        <GradientStop Color="#00FFFFFF" Offset="1" />
    </RadialGradientBrush>
    <VisualBrush x:Key="C1Scheduler_TodayHeader_Brush" RenderOptions.CachingHint="Cache">
        <VisualBrush.Visual>
            <c1sched:PilePanel>
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush5}" />
                <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z" Fill="{StaticResource brush6}" />
            </c1sched:PilePanel>
        </VisualBrush.Visual>
    </VisualBrush>
    <VisualBrush x:Key="C1Scheduler_TodayHeader_HoverBrush" RenderOptions.CachingHint="Cache">
        <VisualBrush.Visual>
            <c1sched:PilePanel>
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush5}" />
                <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z" Fill="{StaticResource brush6}" />
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush7}" />
            </c1sched:PilePanel>
        </VisualBrush.Visual>
    </VisualBrush>

    <!-- this theme specific keys -->
    <DrawingBrush x:Key="C1Scheduler_Today_Background" RenderOptions.CachingHint="Cache">
        <DrawingBrush.Drawing>
            <DrawingGroup>
                <GeometryDrawing>
                    <GeometryDrawing.Brush>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="#FFB5F4FF" Offset="0" />
                            <GradientStop Color="#FF31a8e4" Offset="0.5" />
                            <GradientStop Color="#FF2091da" Offset="1" />
                        </LinearGradientBrush>
                    </GeometryDrawing.Brush>
                    <GeometryDrawing.Geometry>
                        <RectangleGeometry Rect="0,0,1,1" />
                    </GeometryDrawing.Geometry>
                </GeometryDrawing>
                <GeometryDrawing>
                    <GeometryDrawing.Brush>
                        <RadialGradientBrush>
                            <RadialGradientBrush.RelativeTransform>
                                <TransformGroup>
                                    <ScaleTransform CenterX="0" CenterY="0" ScaleX="1" ScaleY="1" />
                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0" CenterY="0" />
                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                    <TranslateTransform X="0" Y="0.5" />
                                </TransformGroup>
                            </RadialGradientBrush.RelativeTransform>
                            <GradientStop Color="#FF5DE5FD" Offset="0" />
                            <GradientStop Color="#00FFFFFF" Offset="1" />
                        </RadialGradientBrush>
                    </GeometryDrawing.Brush>
                    <GeometryDrawing.Geometry>
                        <RectangleGeometry Rect="0,0,1,1" />
                    </GeometryDrawing.Geometry>
                </GeometryDrawing>
            </DrawingGroup>
        </DrawingBrush.Drawing>
    </DrawingBrush>

    <!-- Navigation panels -->
    <VisualBrush x:Key="C1Scheduler_NavPane_Brush" RenderOptions.CachingHint="Cache">
        <VisualBrush.Visual>
            <c1sched:PilePanel>
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush5}" />
                <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z" Fill="{StaticResource brush6}" />
            </c1sched:PilePanel>
        </VisualBrush.Visual>
    </VisualBrush>
    <VisualBrush x:Key="C1Scheduler_NavPane_HoverBrush" RenderOptions.CachingHint="Cache">
        <VisualBrush.Visual>
            <c1sched:PilePanel>
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush5}" />
                <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z" Fill="{StaticResource brush6}" />
                <Rectangle Stroke="{x:Null}" Fill="{StaticResource brush7}" />
            </c1sched:PilePanel>
        </VisualBrush.Visual>
    </VisualBrush>
    <SolidColorBrush x:Key="C1Scheduler_NavPaneText_Brush" Color="#FFFFFFFF" />
    <SolidColorBrush x:Key="C1Scheduler_NavPaneBorder_Brush" Color="#00000000" />

    <!-- C1BrushBuilder style which is used for coloring selected time slot. todo -->
    <Style x:Key="C1Scheduler_TimeSlotSelected_BrushStyle" TargetType="c1:C1BrushBuilder">
        <Setter Property="DesignColor" Value="{StaticResource C1Scheduler_BaseBackgroundColor}" />
        <Setter Property="DesignBrush" Value="{StaticResource C1Scheduler_TimeSlot_SelectedBrush}" />
    </Style>

    <!-- determines the template used for displaying group headers -->
    <DataTemplate x:Key="GroupHeaderTemplate">
        <Grid SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <c1:C1BrushBuilder x:Name="Background" DesignBrush="{StaticResource brush1}" DesignColor="#FFFFFFFF" Input="{Binding Background}" />
            <c1:C1BrushBuilder x:Name="BorderBrush" Style="{StaticResource C1Scheduler_MonthHeaderForeground_BrushStyle}" Input="{Binding Background}" />
            <Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.ColumnSpan="3" BorderThickness="1,0,1,0" BorderBrush="{Binding Output, ElementName=BorderBrush}" Background="{Binding Output, ElementName=Background}" />
            <Button Style="{StaticResource GroupHeaderButton}" Grid.Column="0" VerticalAlignment="Center" Margin="4" Command="c1sched:C1Scheduler.NavigateToPreviousGroupCommand" CommandTarget="{Binding Scheduler}" Visibility="{Binding ShowPreviousButton, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" BorderBrush="{Binding Output, ElementName=BorderBrush}" Background="{Binding Output, ElementName=Background}">
                <Path Data="M4.5352716,0 C4.7911787,0 5.0470867,0.097625732 5.2423372,0.29287648 C5.6328392,0.68337822 5.6328392,1.3165059 5.2423372,1.7070076 L3.1820319,3.7673135 L8.2674026,3.7673135 C8.8196878,3.7673135 9.2674026,4.2150288 9.2674026,4.7673135 C9.2674026,5.3195982 8.8196878,5.7673135 8.2674026,5.7673135 L3.1816781,5.7673135 L5.2423363,7.8279719 C5.6328382,8.2184734 5.6328382,8.8516016 5.2423363,9.2421036 C4.8518353,9.6326046 4.2187071,9.6326046 3.8282053,9.2421026 L0.29287642,5.7067738 C-0.32626158,5.064395 -0.32671508,4.5018373 0.29287884,3.8282032 L3.8282061,0.29287601 C4.0234566,0.097625256 4.2793646,-2.3841858E-07 4.5352716,0 z" Fill="{Binding Output, ElementName=BorderBrush}" Stretch="Fill" Height="10" Width="10" />
            </Button>
            <Button Style="{StaticResource GroupHeaderButton}" Grid.Column="2" VerticalAlignment="Center" Margin="4" Command="c1sched:C1Scheduler.NavigateToNextGroupCommand" CommandTarget="{Binding Scheduler}" Visibility="{Binding ShowNextButton, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" BorderBrush="{Binding Output, ElementName=BorderBrush}" Background="{Binding Output, ElementName=Background}">
                <Path Data="M4.7322359,0 C4.9881582,2.3841858E-07 5.2440805,0.097631216 5.4393425,0.29289341 L8.9748764,3.8284273 C9.5511045,4.4046021 9.5983429,5.0837431 8.9748774,5.7071066 L5.4393435,9.2426405 C5.0488191,9.6331644 4.4156542,9.6331644 4.0251298,9.2426405 C3.6346054,8.8521166 3.6346054,8.2189512 4.0251298,7.8284273 L6.0857897,5.767767 L0.99999994,5.767767 C0.44771519,5.767767 -5.2450769E-08,5.3200521 3.5527137E-15,4.767767 C-5.2450769E-08,4.2154822 0.44771519,3.7677672 0.99999994,3.7677672 L6.0857897,3.7677672 L4.0251293,1.7071068 C3.6346049,1.3165827 3.6346049,0.68341756 4.0251293,0.29289341 C4.2203913,0.097631216 4.4763136,2.3841858E-07 4.7322359,0 z" Fill="{Binding Output, ElementName=BorderBrush}" Stretch="Fill" Height="10" Width="10" />
            </Button>
            <TextBlock Foreground="White" Margin="10,4,10,4" Grid.Column="1" Visibility="{Binding IsSelected, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}, ConverterParameter=Invert}" Text="{Binding DisplayName}" VerticalAlignment="Center" HorizontalAlignment="Center" />
            <TextBlock Foreground="White" Margin="10,4,10,4" Grid.Column="1" FontWeight="Bold" Visibility="{Binding IsSelected, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" Text="{Binding DisplayName}" VerticalAlignment="Center" HorizontalAlignment="Center" />
        </Grid>
    </DataTemplate>

    <!-- very simple Group Header for the TimeLine view -->
    <DataTemplate x:Key="TimeLineGroupHeaderTemplate">
        <Grid IsHitTestVisible="False">
            <c1:C1BrushBuilder x:Name="Background" DesignBrush="{StaticResource brush1}" DesignColor="#FFFFFFFF" Input="{Binding Background}" />
            <c1:C1BrushBuilder x:Name="BorderBrush" Style="{StaticResource C1Scheduler_MonthHeaderForeground_BrushStyle}" Input="{Binding Background}" />
            <Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch" BorderThickness="4,1,0,1" BorderBrush="{Binding Output, ElementName=BorderBrush}" Background="{Binding Output, ElementName=Background}">
                <TextBlock TextWrapping="Wrap" Foreground="White" Margin="2" Text="{Binding DisplayName}" VerticalAlignment="Center" HorizontalAlignment="Center" />
            </Border>
        </Grid>
    </DataTemplate>

    <!-- determines the style of the month grid header (week day names) -->
    <Style x:Key="C1Scheduler_MonthHeader_Style" TargetType="{x:Type ContentControl}">
        <Setter Property="Foreground" Value="{Binding ControlForeground,          RelativeSource={RelativeSource AncestorType={x:Type c1sched:C1Scheduler}}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContentControl}">
                    <ContentPresenter Margin="0,2,0,2" Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- determines the style of the prev button -->
    <Style x:Key="C1Scheduler_PreviousButton_Style" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="{DynamicResource C1Scheduler_NavPaneBorder_Brush}" Background="{DynamicResource C1Scheduler_NavPane_Brush}">
                            <Border Name="MouseOverElement" CornerRadius="5,5,5,5" Visibility="Collapsed" Background="{DynamicResource C1Scheduler_NavPane_HoverBrush}" />
                        </Border>
                        <Grid TextBlock.Foreground="{DynamicResource C1Scheduler_NavPaneText_Brush}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="20" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="30" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Padding="0,3,0,3" Grid.Column="1" Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                            <TextBlock Padding="3,0,3,0" Text="&gt;|" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <TextBlock.LayoutTransform>
                                    <RotateTransform Angle="-90" />
                                </TextBlock.LayoutTransform>
                            </TextBlock>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- determines the style of the next button -->
    <Style x:Key="C1Scheduler_NextButton_Style" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid SnapsToDevicePixels="True">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border CornerRadius="5,5,5,5" BorderThickness="1" BorderBrush="{DynamicResource C1Scheduler_NavPaneBorder_Brush}" Background="{DynamicResource C1Scheduler_NavPane_Brush}">
                            <Border Name="MouseOverElement" CornerRadius="5,5,5,5" Visibility="Collapsed" Background="{DynamicResource C1Scheduler_NavPane_HoverBrush}" />
                        </Border>
                        <Grid TextBlock.Foreground="{DynamicResource C1Scheduler_NavPaneText_Brush}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="20" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="30" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Padding="0,3,0,3" Grid.Column="1" Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                            <TextBlock Padding="3,0,3,0" Text="&gt;|" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                                <TextBlock.LayoutTransform>
                                    <RotateTransform Angle="90" />
                                </TextBlock.LayoutTransform>
                            </TextBlock>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- determines the style of the day header. It is used in all Office 2007 views -->
    <Style x:Key="C1Scheduler_DayHeaderButton_Style" TargetType="Button">
        <Setter Property="BorderThickness" Value="0.25,0,0.25,0" />
        <Setter Property="BorderBrush" Value="{DynamicResource C1Scheduler_DayHeaderBorder_Brush}" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Background" Value="{DynamicResource C1Scheduler_DayHeader_Brush}" />
        <Setter Property="Foreground" Value="{Binding Foreground,          RelativeSource={RelativeSource AncestorType={x:Type c1sched:C1Scheduler}}}" />
        <Setter Property="TextBlock.FontSize" Value="10" />
        <Setter Property="TextBlock.FontWeight" Value="Semibold" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="DayHeaderBorder" CornerRadius="5" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter Content="{TemplateBinding Content}" ClipToBounds="True" Margin="{TemplateBinding Padding}" TextBlock.Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="DayHeaderBorder" Property="Background" Value="{DynamicResource C1Scheduler_DayHeader_HoverBrush}" />
                        </Trigger>
                        <DataTrigger Binding="{Binding IsToday}" Value="True">
                            <Setter TargetName="DayHeaderBorder" Property="Background" Value="{DynamicResource C1Scheduler_TodayHeader_Brush}" />
                        </DataTrigger>
                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
                                <Condition Binding="{Binding IsToday}" Value="true" />
                            </MultiDataTrigger.Conditions>
                            <Setter TargetName="DayHeaderBorder" Property="Background" Value="{DynamicResource C1Scheduler_TodayHeader_HoverBrush}" />
                        </MultiDataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- determines the style used for displaying time slots in a Day view.
         Copy it into every theme, as using DynamicResource here affects performance -->
    <c1sched:TimeSlotStyleSelector x:Key="TimeSlotStyleSelector">
        <!-- Don't use selection states. With selection states multiple selection works incorrectly. -->
        <c1sched:TimeSlotStyleSelector.Resources>
            <ResourceDictionary>
                <Style x:Key="C1Scheduler_WorkSlot_Style" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_WorkHourLightBorder_Brush}" />
                    <Setter Property="Background" Value="{StaticResource C1Scheduler_WorkHour_Brush}" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="c1sched:VisualIntervalPresenter">
                                <Grid>
                                    <Border Background="{TemplateBinding Background}" BorderThickness="0,1,0,0" IsHitTestVisible="False" BorderBrush="{TemplateBinding BorderBrush}">
                                        <Rectangle Fill="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type c1sched:VisualIntervalsPresenter}}}" Visibility="{Binding IsSelected, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" />
                                    </Border>
                                    <ContentPresenter Content="{TemplateBinding Content}" Margin="0,1,0,0" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

                <Style x:Key="C1Scheduler_TopWorkSlot_Style" BasedOn="{StaticResource C1Scheduler_WorkSlot_Style}" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_WorkHourBorder_Brush}" />
                </Style>

                <Style x:Key="C1Scheduler_FreeSlot_Style" BasedOn="{StaticResource C1Scheduler_WorkSlot_Style}" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_FreeHourLightBorder_Brush}" />
                    <Setter Property="Background" Value="{StaticResource C1Scheduler_FreeHour_Brush}" />
                </Style>

                <Style x:Key="C1Scheduler_TopFreeSlot_Style" BasedOn="{StaticResource C1Scheduler_FreeSlot_Style}" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_FreeHourBorder_Brush}" />
                </Style>
            </ResourceDictionary>
        </c1sched:TimeSlotStyleSelector.Resources>
    </c1sched:TimeSlotStyleSelector>

    <!-- Determines the style used for displaying time slots in the TimeLine view availability status line.
         Copy it into every theme, as using DynamicResource here affects performance -->
    <c1sched:TimeSlotStyleSelector x:Key="AvailabilityStatusStyleSelector">
        <c1sched:TimeSlotStyleSelector.Resources>
            <ResourceDictionary>
                <Style x:Key="C1Scheduler_WorkSlot_Style" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_WorkHourLightBorder_Brush}" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="c1sched:VisualIntervalPresenter">
                                <!-- Background="{Binding Path=Scheduler.AlternatingBackground}"-->
                                <Border x:Name="IntervalBorder" IsHitTestVisible="False" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" BorderThickness="1,0,0,0" BorderBrush="{TemplateBinding BorderBrush}">
                                    <Rectangle Fill="{Binding Path=TotalStatusBrush}" Margin="-1,7,0,7" />
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

                <Style x:Key="C1Scheduler_TopWorkSlot_Style" BasedOn="{StaticResource C1Scheduler_WorkSlot_Style}" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_WorkHourBorder_Brush}" />
                </Style>

                <Style x:Key="C1Scheduler_FreeSlot_Style" BasedOn="{StaticResource C1Scheduler_WorkSlot_Style}" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_FreeHourLightBorder_Brush}" />
                </Style>

                <Style x:Key="C1Scheduler_TopFreeSlot_Style" BasedOn="{StaticResource C1Scheduler_WorkSlot_Style}" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_FreeHourBorder_Brush}" />
                </Style>
            </ResourceDictionary>
        </c1sched:TimeSlotStyleSelector.Resources>
    </c1sched:TimeSlotStyleSelector>

    <!-- Determines the style used for displaying time slots in the TimeLine view.
         Copy it into every theme, as using DynamicResource here affects performance -->
    <c1sched:TimeSlotStyleSelector x:Key="HorizontalTimeSlotStyleSelector">
        <c1sched:TimeSlotStyleSelector.Resources>
            <ResourceDictionary>
                <Style x:Key="C1Scheduler_WorkSlot_Style" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_WorkHourLightBorder_Brush}" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="c1sched:VisualIntervalPresenter">
                                <Grid>
                                    <Border x:Name="IntervalBorder" IsHitTestVisible="False" Background="{Binding Path=Scheduler.AlternatingBackground}" BorderThickness="1,0,0,0" BorderBrush="{TemplateBinding BorderBrush}">
                                        <Rectangle Fill="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type c1sched:VisualIntervalsPresenter}}}" Visibility="{Binding IsSelected, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" />
                                    </Border>
                                    <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="1,0,0,0" />
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

                <Style x:Key="C1Scheduler_TopWorkSlot_Style" BasedOn="{StaticResource C1Scheduler_WorkSlot_Style}" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_WorkHourBorder_Brush}" />
                </Style>

                <Style x:Key="C1Scheduler_FreeSlot_Style" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_FreeHourLightBorder_Brush}" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="c1sched:VisualIntervalPresenter">
                                <Grid>
                                    <Border x:Name="IntervalBorder" IsHitTestVisible="False" Background="{StaticResource C1Scheduler_FreeHour_Brush}" BorderThickness="1,0,0,0" BorderBrush="{TemplateBinding BorderBrush}">
                                        <Rectangle Fill="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type c1sched:VisualIntervalsPresenter}}}" Visibility="{Binding IsSelected, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" />
                                    </Border>
                                    <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="1,0,0,0" />
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

                <Style x:Key="C1Scheduler_TopFreeSlot_Style" BasedOn="{StaticResource C1Scheduler_FreeSlot_Style}" TargetType="c1sched:VisualIntervalPresenter">
                    <Setter Property="BorderBrush" Value="{StaticResource C1Scheduler_FreeHourBorder_Brush}" />
                </Style>
            </ResourceDictionary>
        </c1sched:TimeSlotStyleSelector.Resources>
    </c1sched:TimeSlotStyleSelector>

    <!-- determines the style of the day group in a day view -->
    <Style TargetType="GroupItem" x:Key="C1Scheduler_DayGroup_Style">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GroupItem">
                    <Grid>
                        <Border BorderThickness="2,0,2,0" x:Name="border" CornerRadius="4" SnapsToDevicePixels="True" BorderBrush="{DynamicResource C1Scheduler_Border_Brush}">
                            <ItemsPresenter />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding IsToday}" Value="True">
                            <Setter TargetName="border" Property="Background" Value="{DynamicResource C1Scheduler_Today_Background}" />
                            <Setter TargetName="border" Property="BorderThickness" Value="2,0,2,0" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- determines the style used for displaying All-Day area in a Day view -->
    <Style x:Key="C1Scheduler_AllDayInterval_Style" TargetType="c1sched:VisualIntervalPresenter">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1sched:VisualIntervalPresenter">
                    <Grid SnapsToDevicePixels="True">
                        <Border x:Name="AllDayBorder" IsHitTestVisible="False" Background="{DynamicResource C1Scheduler_AllDayArea_Brush}" BorderThickness="{DynamicResource C1Scheduler_AllDayAreaBorder_Thickness}" BorderBrush="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type c1sched:VisualIntervalGroupsPresenter}}}">
                            <Rectangle Fill="{DynamicResource C1Scheduler_AllDayArea_SelectedBrush}" Visibility="{Binding IsSelected, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" />
                        </Border>
                        <Border Background="{Binding Path=VisualIntervals[0].StatusBrush}" Opacity="0.2" Margin="{Binding BorderThickness, ElementName=AllDayBorder}" c1sched:CoverElementsPane.Orientation="Horizontal" c1sched:CoverElementsPane.PaneName="allDayPane" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- determines the template used for the single time interval of a time ruler in a Day view -->
    <DataTemplate x:Key="C1Scheduler_TimeRuler_Template">
        <Grid SnapsToDevicePixels="True">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="30" />
                <ColumnDefinition MinWidth="25" />
            </Grid.ColumnDefinitions>
            <c1sched:TimeRulerHelper Interval="{Binding}" x:Name="helper" />
            <TextBlock FontSize="10" Grid.Column="0" Foreground="{Binding Path=Scheduler.ControlForeground}" Visibility="{Binding IsZeroMinute, ElementName=helper, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" HorizontalAlignment="Right" Padding="0" Margin="4,0,0,0" Text="{Binding Hours, ElementName=helper}" />
            <TextBlock FontSize="10" Grid.Column="1" Visibility="{Binding IsZeroMinute, ElementName=helper, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" Foreground="{Binding Path=Scheduler.ControlForeground}" HorizontalAlignment="Right" Padding="0" Margin="0,0,4,0" Text="{Binding Minutes, ElementName=helper}" />
        </Grid>
    </DataTemplate>

    <!-- Style that represents base One Day View -->
    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type c1sched:C1Scheduler},    ResourceId=OneDayStyle}" TargetType="c1sched:C1Scheduler" BasedOn="{StaticResource BaseOneDayStyle}">
        <Setter Property="VisualIntervalGroupStyles">
            <Setter.Value>
                <c1sched:IntervalGroupStyleCollection>
                    <GroupStyle ContainerStyle="{StaticResource C1Scheduler_DayGroup_Style}">
                        <GroupStyle.Panel>
                            <ItemsPanelTemplate>
                                <UniformGrid Rows="1" />
                            </ItemsPanelTemplate>
                        </GroupStyle.Panel>
                    </GroupStyle>
                </c1sched:IntervalGroupStyleCollection>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Determines the style used for displaying overflow jumper in a Month View when not all 
       appointment elements fit into available day space. -->
    <Style x:Key="C1Scheduler_OverflowJumper_Style" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Polygon x:Name="arrow" Points="0,0 5,6 10,0" Fill="LightGray" Margin="2">
                        <ToolTipService.ToolTip>
                            <TextBlock>
                                <TextBlock.Text>
                                    <c1sched:SchedulerLoc Key="MiscStrings:MoreAppointments" DefaultValue="Click for more appointments." />
                                </TextBlock.Text>
                            </TextBlock>
                        </ToolTipService.ToolTip>
                    </Polygon>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="arrow" Property="Fill" Value="White" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- determines the style used for displaying single day in a Month view -->
    <c1sched:DayIntervalStyleSelector x:Key="MonthDayStyleSelector">
        <c1sched:DayIntervalStyleSelector.Resources>
            <ResourceDictionary>
                <VisualBrush x:Key="AlternateDayHeader_Brush" RenderOptions.CachingHint="Cache">
                    <VisualBrush.Visual>
                        <c1sched:PilePanel>
                            <Rectangle Stroke="{x:Null}">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                        <GradientStop Color="#FF575757" Offset="0" />
                                        <GradientStop Color="#FF3E3E3E" Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Path Margin="0,0,0,20" Stretch="Fill" Stroke="{x:Null}" Data="M0,0 L311,0 L311,50 L0,50 z">
                                <Path.Fill>
                                    <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                                        <GradientStop Color="#00636363" Offset="0" />
                                        <GradientStop Color="#7E636363" Offset="0.5" />
                                        <GradientStop Color="#00636363" Offset="1" />
                                    </LinearGradientBrush>
                                </Path.Fill>
                            </Path>
                        </c1sched:PilePanel>
                    </VisualBrush.Visual>
                </VisualBrush>

                <DataTemplate x:Key="DayHeaderTemplate">
                    <Button x:Name="headerButton" BorderThickness="2,2,2,0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Center" CommandParameter="{Binding Path=Scheduler.OneDayStyle}" Background="{StaticResource AlternateDayHeader_Brush}" Command="c1sched:C1Scheduler.ChangeStyleCommand" Style="{DynamicResource C1Scheduler_DayHeaderButton_Style}">
                        <DockPanel x:Name="dayHeader" TextBlock.Foreground="White">
                            <TextBlock DockPanel.Dock="Right" Margin="2" FontWeight="Semibold" Text="{Binding Converter={x:Static c1sched:VisualIntervalToStringConverter.Default},                                        ConverterParameter=MonthViewDayHeaderDayFormat}" />
                            <TextBlock DockPanel.Dock="Left" x:Name="MonthName" Margin="2,2,0,2" FontWeight="Semibold" Text="{Binding Converter={x:Static c1sched:MonthToStringConverter.Default}}" />
                            <!-- Add empty block to fill panel (it's needed for command) -->
                            <TextBlock />
                        </DockPanel>
                    </Button>
                    <DataTemplate.Triggers>
                        <DataTrigger Value="1">
                            <DataTrigger.Binding>
                                <MultiBinding Converter="{x:Static c1sched:DoubleArithmeticOperationMultiConverter.Default}" ConverterParameter="Modulus">
                                    <Binding Path="StartTime.Month" Mode="OneTime" />
                                    <Binding Source="2" />
                                </MultiBinding>
                            </DataTrigger.Binding>
                            <Setter TargetName="headerButton" Property="Background" Value="{DynamicResource C1Scheduler_DayHeader_Brush}" />
                            <Setter TargetName="dayHeader" Property="TextBlock.Foreground" Value="#FF000000" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>

                <DataTemplate x:Key="VisualIntervalTemplate">
                    <c1sched:PilePanel Margin="0,3,0,0">
                        <Border x:Name="DayContentBorder" SnapsToDevicePixels="True" CornerRadius="5" IsHitTestVisible="False" Background="{DynamicResource C1Scheduler_AlternateMonthDay_Brush}">
                            <Border x:Name="selectionBorder" Background="{DynamicResource C1Scheduler_WorkHour_Brush}" CornerRadius="5" Visibility="{Binding IsSelected, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" />
                        </Border>
                        <Border x:Name="DayStatusBorder" c1sched:CoverElementsPane.Orientation="Horizontal" Background="{Binding Path=StatusBrush}" CornerRadius="5" Opacity="0.3" />
                        <Button FocusVisualStyle="{x:Null}" CommandParameter="{Binding Path=Scheduler.OneDayStyle}" Command="c1sched:C1Scheduler.ChangeStyleCommand" x:Name="overflowJumper" HorizontalAlignment="Right" Visibility="{Binding Path=(c1sched:CoverElementsPane.CoverElementsOverflow),                                 ElementName=DayStatusBorder, Converter={x:Static c1sched:BooleanToVisibilityConverter.Default}}" VerticalAlignment="Bottom" Style="{DynamicResource C1Scheduler_OverflowJumper_Style}" />
                    </c1sched:PilePanel>
                    <DataTemplate.Triggers>
                        <DataTrigger Value="1">
                            <DataTrigger.Binding>
                                <MultiBinding Converter="{x:Static c1sched:DoubleArithmeticOperationMultiConverter.Default}" ConverterParameter="Modulus">
                                    <Binding Path="StartTime.Month" Mode="OneTime" />
                                    <Binding Source="2" />
                                </MultiBinding>
                            </DataTrigger.Binding>
                            <Setter TargetName="DayContentBorder" Property="Background" Value="{DynamicResource C1Scheduler_FreeHour_Brush}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding IsToday}" Value="True">
                            <Setter TargetName="DayContentBorder" Property="Background" Value="{DynamicResource C1Scheduler_Today_Background}" />
                            <Setter TargetName="selectionBorder" Property="Opacity" Value="0.5" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>

                <!-- determines the day style -->
                <Style x:Key="C1Scheduler_Day_Style" TargetType="ListBoxItem">
                    <Setter Property="BorderBrush" Value="{DynamicResource C1Scheduler_Border_Brush}" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListBoxItem">
                                <Grid SnapsToDevicePixels="True">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <ContentPresenter Grid.Row="0" Content="{TemplateBinding Content}" ContentTemplate="{StaticResource DayHeaderTemplate}" />
                                    <Border Grid.Row="1" BorderThickness="2,0,2,2" BorderBrush="{TemplateBinding BorderBrush}">
                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{StaticResource VisualIntervalTemplate}" />
                                    </Border>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>

                <!-- determines the current date style -->
                <Style x:Key="C1Scheduler_Today_Style" TargetType="ListBoxItem" BasedOn="{StaticResource C1Scheduler_Day_Style}">
                </Style>
            </ResourceDictionary>
        </c1sched:DayIntervalStyleSelector.Resources>
    </c1sched:DayIntervalStyleSelector>

    <!-- determines the style of the week tab -->
    <Style x:Key="C1Scheduler_WeekTab_Style" TargetType="Button">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Background" Value="{DynamicResource C1Scheduler_WeekTab_Brush}" />
        <Setter Property="TextBlock.FontSize" Value="10" />
        <Setter Property="TextBlock.FontWeight" Value="Semibold" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="WeekTabBorder" CornerRadius="5" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                        <ContentPresenter Content="{TemplateBinding Content}" ClipToBounds="True" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="WeekTabBorder" Property="Background" Value="{DynamicResource C1Scheduler_WeekTab_HoverBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type c1sched:C1Scheduler},    ResourceId=WeekStyle}" TargetType="c1sched:C1Scheduler" BasedOn="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type c1sched:C1Scheduler},    ResourceId=OneDayStyle}}">
        <Setter Property="VisualTimeSpan" Value="7" />
    </Style>

    <Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type c1sched:C1Scheduler},    ResourceId=WorkingWeekStyle}" TargetType="c1sched:C1Scheduler" BasedOn="{StaticResource {ComponentResourceKey TypeInTargetAssembly={x:Type c1sched:C1Scheduler},    ResourceId= OneDayStyle}}">
        <Setter Property="VisualTimeSpan" Value="7" />
    </Style>

</ResourceDictionary>