<Page
    x:Class="ScheduleSamples.DefaultView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c1="using:C1.Xaml.Schedule"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.BottomAppBar>
        <CommandBar IsOpen="false" ClosedDisplayMode="Minimal" RequestedTheme="Dark" >
            <AppBarButton x:Name="TodayButton" Icon="GoToToday" Label="Today" Click="Today_Click" Visibility="Collapsed"/>
            <AppBarButton Icon="Add" Label="New" Click="Add_Click"/>
            <AppBarButton x:Name="ViewButton" Icon="Switch" Label="DayView" Click="View_Click" Visibility="Collapsed"/>
        </CommandBar>
    </Page.BottomAppBar>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
            <StackPanel.Resources>
                <Style TargetType="Button" x:Key="btnStyle">
                    <Setter Property="VerticalAlignment" Value="Stretch"/>
                    <Setter Property="BorderThickness" Value="0"/>
                    <Setter Property="MinWidth" Value="70"/>
                </Style>
            </StackPanel.Resources>
            <Button Click="DayClick" Style="{StaticResource btnStyle}">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="&#xe161;" FontFamily="Segoe UI Symbol" FontSize="22" VerticalAlignment="Center"/>
                        <TextBlock Text=" Day" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button x:Name="WorkWeekButton" Click="WorkWeekClick" Style="{StaticResource btnStyle}">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="&#xe162;" FontFamily="Segoe UI Symbol" FontSize="22" VerticalAlignment="Center"/>
                        <TextBlock Text=" Work Week" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button x:Name="WeekButton" Click="WeekClick" Style="{StaticResource btnStyle}">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="&#xe162;" FontFamily="Segoe UI Symbol" FontSize="22" VerticalAlignment="Center"/>
                        <TextBlock Text=" Week" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button Click="MonthClick" Style="{StaticResource btnStyle}">
                <Button.Content>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="&#xe163;" FontFamily="Segoe UI Symbol" FontSize="22" VerticalAlignment="Center"/>
                        <TextBlock Text=" Month" VerticalAlignment="Center"/>
                    </StackPanel>
                </Button.Content>
            </Button>
            <Button Content="Export" Click="Export_Click" Style="{StaticResource btnStyle}"/>
            <Button Content="Import" Click="Import_Click" Style="{StaticResource btnStyle}"/>
        </StackPanel>
        <c1:C1Scheduler x:Name="sched1" Grid.Row="1" />

        <VisualStateManager.VisualStateGroups>
            <!-- Visual states reflect the application's window size -->
            <VisualStateGroup>
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="540" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>

                    </VisualState.Setters>
                </VisualState>

                <VisualState x:Name="NarrowLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="WorkWeekButton.Visibility" Value="Collapsed" />
                        <Setter Target="WeekButton.Visibility" Value="Collapsed" />
                        <Setter Target="TodayButton.Visibility" Value="Visible" />
                        <Setter Target="ViewButton.Visibility" Value="Visible" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>
