<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="CustomGroupingView.MainPage" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" Background="#FF374F5D" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary x:Key="custom_theme" Source="CustomViews.xaml" />
            <!-- 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>

            <!-- C1Menu styles-->
            <ControlTemplate TargetType="c1:C1Separator" x:Key="FirstLevelSeparatorTemplate">
                <Grid x:Name="Root" Background="#FF3C688D" Opacity="0.2" Margin="2,5,5,8">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="0.5" />
                    </Grid.ColumnDefinitions>
                </Grid>
            </ControlTemplate>
            <Style TargetType="c1:C1Separator" x:Key="Separator">
                <Setter Property="FirstLevelTemplate" Value="{StaticResource FirstLevelSeparatorTemplate}" />
            </Style>
            <Style TargetType="c1:C1MenuItem" x:Key="MenuItemStyle">
                <Setter Property="Padding" Value="2" />
                <Setter Property="Margin" Value="2,2,2,5" />
            </Style>

            <Style x:Key="looklessButtonStyle" TargetType="Button">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="Margin" Value="0,1,0,1" />
                <Setter Property="Padding" Value="0" />
                <Setter Property="HorizontalAlignment" Value="Stretch" />
                <Setter Property="VerticalAlignment" Value="Stretch" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Button">
                            <Border Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}">
                                <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <c1:C1Menu Grid.Row="0" FontFamily="Segoe UI" BorderThickness="1" Height="30">
            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="NoWrap" Margin="4,2" Text="Contacts navigation:" />
            <c1:C1MenuItem Margin="2">
                <c1:C1MenuItem.Header>
                    <Button Content="|&lt;&lt;" Style="{StaticResource looklessButtonStyle}" c1:CommandExtensions.Command="c1:C1Scheduler.NavigateToPreviousGroupCommand" c1:CommandExtensions.CommandParameter="Home" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" />
                </c1:C1MenuItem.Header>
            </c1:C1MenuItem>
            <c1:C1MenuItem Margin="2">
                <c1:C1MenuItem.Header>
                    <Button Content="&lt;&lt;" Style="{StaticResource looklessButtonStyle}" c1:CommandExtensions.Command="c1:C1Scheduler.NavigateToPreviousGroupCommand" c1:CommandExtensions.CommandParameter="Page" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" />
                </c1:C1MenuItem.Header>
            </c1:C1MenuItem>
            <c1:C1MenuItem Margin="2">
                <c1:C1MenuItem.Header>
                    <Button Content="&lt;" Style="{StaticResource looklessButtonStyle}" c1:CommandExtensions.Command="c1:C1Scheduler.NavigateToPreviousGroupCommand" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" />
                </c1:C1MenuItem.Header>
            </c1:C1MenuItem>
            <c1:C1MenuItem Margin="2">
                <c1:C1MenuItem.Header>
                    <Button Content="&gt;" Style="{StaticResource looklessButtonStyle}" c1:CommandExtensions.Command="c1:C1Scheduler.NavigateToNextGroupCommand" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" />
                </c1:C1MenuItem.Header>
            </c1:C1MenuItem>
            <c1:C1MenuItem Margin="2">
                <c1:C1MenuItem.Header>
                    <Button Content="&gt;&gt;" Style="{StaticResource looklessButtonStyle}" c1:CommandExtensions.Command="c1:C1Scheduler.NavigateToNextGroupCommand" c1:CommandExtensions.CommandParameter="Page" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" />
                </c1:C1MenuItem.Header>
            </c1:C1MenuItem>
            <c1:C1MenuItem Margin="2">
                <c1:C1MenuItem.Header>
                    <Button Content="&gt;&gt;|" Style="{StaticResource looklessButtonStyle}" c1:CommandExtensions.Command="c1:C1Scheduler.NavigateToNextGroupCommand" c1:CommandExtensions.CommandParameter="End" c1:CommandExtensions.CommandTarget="{Binding ElementName=sched1}" />
                </c1:C1MenuItem.Header>
            </c1:C1MenuItem>
            <c1:C1Separator Style="{StaticResource Separator}" />
            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="NoWrap" Margin="4,2" Text="Contacts per page:" />
            <c1:C1NumericBox Margin="2" Value="{Binding GroupPageSize, ElementName=sched1, Mode=TwoWay}" Minimum="1" Maximum="5" MinWidth="35" />
        </c1:C1Menu>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="192" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <c1:C1Calendar x:Name="cal1" Grid.Column="0" 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" BorderThickness="1" Grid.Column="1" BorderBrush="{StaticResource BorderBrush}" Theme="{StaticResource custom_theme}" Style="{Binding WorkingWeekStyle, RelativeSource={RelativeSource Self}}">
                <c1:C1Scheduler.Settings>
                    <c1:C1SchedulerSettings FirstVisibleTime="7:00:00" />
                </c1:C1Scheduler.Settings>
            </c1:C1Scheduler>
        </Grid>
    </Grid>
</UserControl>