<Page
    x:Class="NetworkAssist.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:android="http://uno.ui/android"
    xmlns:converters="using:NetworkAssist.Converters"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ios="http://uno.ui/ios"
    xmlns:local="using:NetworkAssist"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="using:Uno.UI.Toolkit"
    xmlns:views="using:NetworkAssist.Views"
    xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    mc:Ignorable="d android ios">

    <Grid toolkit:VisibleBoundsPadding.PaddingMask="All" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <views:ArrivalsControl x:Name="Arrivals" Visibility="Visible" />
        <views:QuickReportControl x:Name="QuickReport" Visibility="Collapsed" />

        <android:Grid Grid.Row="1">
            <material:BottomNavigationBar xmlns:material="using:Uno.Material.Controls">
                <material:BottomNavigationBar.Items>
                    <material:BottomNavigationBarItem Click="ShowArrivals">
                        <material:BottomNavigationBarItem.Icon>
                            <SymbolIcon Symbol="Clock" />
                        </material:BottomNavigationBarItem.Icon>
                    </material:BottomNavigationBarItem>
                    <material:BottomNavigationBarItem Click="ShowQuickReport">
                        <material:BottomNavigationBarItem.Icon>
                            <FontIcon Glyph="&#xE724;" />
                        </material:BottomNavigationBarItem.Icon>
                    </material:BottomNavigationBarItem>
                </material:BottomNavigationBar.Items>
            </material:BottomNavigationBar>
        </android:Grid>
        <win:Grid Grid.Row="1">

            <CommandBar VerticalAlignment="Bottom">
                <CommandBar.PrimaryCommands>
                    <AppBarButton
                        Click="ShowArrivals"
                        Icon="Clock"
                        Label="Arrivals" />
                    <AppBarButton Click="ShowQuickReport" Label="Quick Report">
                        <AppBarButton.Icon>
                            <FontIcon Glyph="&#xE724;" />
                        </AppBarButton.Icon>
                    </AppBarButton>
                </CommandBar.PrimaryCommands>
            </CommandBar>
        </win:Grid>

        <ios:Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.Resources>
                <converters:CupertinoButtonColorConverter x:Key="CupertinoBtnColor" />
            </Grid.Resources>
            <Button
                HorizontalAlignment="Center"
                Click="ShowArrivals"
                Foreground="{Binding ElementName=Arrivals, Path=Visibility, Converter={StaticResource CupertinoBtnColor}, ConverterParameter=Visible, Mode=OneWay}">
                <StackPanel>
                    <SymbolIcon
                        Width="25"
                        Height="25"
                        HorizontalAlignment="Center"
                        Symbol="Clock" />
                    <TextBlock>Arrivals</TextBlock>
                </StackPanel>
            </Button>
            <Button
                Grid.Column="1"
                HorizontalAlignment="Center"
                Click="ShowQuickReport"
                Foreground="{Binding ElementName=QuickReport, Path=Visibility, Converter={StaticResource CupertinoBtnColor}, ConverterParameter=Visible, Mode=OneWay}">
                <StackPanel>
                    <FontIcon
                        Width="25"
                        Height="25"
                        HorizontalAlignment="Center"
                        Glyph="&#xE724;" />
                    <TextBlock>Quick Report</TextBlock>
                </StackPanel>
            </Button>
        </ios:Grid>

    </Grid>
</Page>
