<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="SharedResources.StandardTipPage"
             Title="StandardTipPage">

    <ContentPage.Resources>
        <ResourceDictionary>
            <Color x:Key="bgColor">#C0C0C0</Color>
            <Color x:Key="fgColor">#0000AD</Color>
            <x:Double x:Key="fontSize">22</x:Double>

            <Style x:Key="baseLabelStyle" TargetType="Label">
                <Setter Property="FontSize" Value="{StaticResource fontSize}"/>
            </Style>

            <Style x:Key="infoLabelStyle" BasedOn="{StaticResource baseLabelStyle}" TargetType="Label">
                <Setter Property="FontAttributes" Value="Bold"/>
            </Style>
        </ResourceDictionary>
    </ContentPage.Resources>
    
    
    <Grid x:Name="LayoutRoot" BackgroundColor="{DynamicResource bgColor}" Padding="10"
          RowDefinitions="Auto,Auto,Auto,Auto,*"
          ColumnDefinitions="*,3*">

        <!-- Left column = static labels -->
        <Label x:Name="billLabel"  Text="Bill"  TextColor="{DynamicResource fgColor}" Style="{StaticResource infoLabelStyle}" Grid.Row="0" Grid.Column="0" />
        <Label x:Name="tipLabel"   Text="Tip"   TextColor="{DynamicResource fgColor}" Style="{StaticResource infoLabelStyle}" FontAttributes="Bold" Grid.Row="1" Grid.Column="0" />
        <Label x:Name="totalLabel" Text="Total" TextColor="{DynamicResource fgColor}" Style="{StaticResource infoLabelStyle}" FontAttributes="Bold" Grid.Row="2" Grid.Column="0" />

        <!-- Right column = user input and calculated-value output -->
        <Entry x:Name="billInput"   Placeholder="Enter Amount" Keyboard="Numeric" TextColor="OrangeRed" Grid.Row="0" Grid.Column="1" />
        <Label x:Name="tipOutput"   Text="0.00" TextColor="{DynamicResource fgColor}" Style="{StaticResource baseLabelStyle}"   Grid.Row="1" Grid.Column="1" />
        <Label x:Name="totalOutput" Text="0.00" TextColor="{DynamicResource fgColor}" Style="{StaticResource baseLabelStyle}"   Grid.Row="2" Grid.Column="1" />

        <!-- Navigate to advanced-view page -->
        <Button Text="Use Custom Calculator" Clicked="GotoCustom" TextColor="White" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" />

        <!-- Swap the foreground/background colors of this page -->
        <HorizontalStackLayout HorizontalOptions="Center" VerticalOptions="End" Spacing="100" Grid.Row="4" Grid.ColumnSpan="2">
            <Button Clicked="OnLight" Text="Light" TextColor="{DynamicResource fgColor}" Grid.Column="0" />
            <Button Clicked="OnDark"  Text="Dark"  TextColor="{DynamicResource fgColor}" Grid.Column="1" />
        </HorizontalStackLayout>

    </Grid>
</ContentPage>