<?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="Banquale.Views.Balance.BalancePage"
             xmlns:local="clr-namespace:Banquale.Views.Balance"
             Shell.NavBarIsVisible="False">
    
    <Grid RowDefinitions="auto, auto, *" x:Name="Grid">

        <Frame BackgroundColor="{StaticResource Key=Banquale}"
               CornerRadius="15"
               HorizontalOptions="Center"
               HeightRequest="120"
               WidthRequest="230"
               Margin="0, 50, 0, 50">

            <Grid BackgroundColor="Transparent"
                  HorizontalOptions="Center"
                  HeightRequest="100"
                  MaximumHeightRequest="150"
                  
                  RowDefinitions="auto, 35, *"
                  ColumnDefinitions="250, auto">

                <Grid.GestureRecognizers>
                    <TapGestureRecognizer
                        Tapped="Balance_Clicked"
                        NumberOfTapsRequired="1" />
                </Grid.GestureRecognizers>

                <Label
                    Text="Compte Professionnel"
                    HorizontalOptions="Center"
                    Margin="0, 15, 0, 0"/>

                <HorizontalStackLayout
                    Grid.Row="1"
                    HorizontalOptions="Center">

                    <Label
                        Text="{Binding Name}"
                        Margin="0, 0, 5, 0"/>

                    <Label
                        Text="{Binding FirstName}"
                        Margin="5, 0, 0, 0"/>

                </HorizontalStackLayout>

                <Grid ColumnDefinitions="auto, auto, auto"
                      Grid.Row="2"
                      HorizontalOptions="Center">

                    <Label
                        Text="Solde"
                        Margin="0, 0, 50, 0"/>
                    <Label
                        Text="{Binding Balance, StringFormat='{0} €'}"
                        Grid.Column="1"
                        Margin="50, 0, 5, 0"/>

                </Grid>
            </Grid>

        </Frame>

        <BoxView
            Color="{StaticResource Key=Gray100}"
            Grid.Row="1"
            HeightRequest="1"/>

        <local:BalanceView
            Grid.Row="2"/>

    </Grid>
</ContentPage>
