<?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.TransactionsPage"
             xmlns:conv="clr-namespace:Banquale.Views.Converters"
             Title="TransactionsPage">

    <ContentPage.Resources>
        <conv:Bool2ColorConverters x:Key="bool2ColorConverters"/>
    </ContentPage.Resources>
    <!--<Grid RowDefinitions="2*, *, 0*, *, 0*, *, *, *, *, *, *">
        
        <Grid Grid.Row="1"  ColumnDefinitions="2*, *, 2*">
            <Label Grid.Column="1"
                   Text="Prix"
                   HorizontalOptions="Center"
                   FontSize="Large"/>
        </Grid>

        <Grid Grid.Row="3" ColumnDefinitions="*, *, *">
            <Label Grid.Column="1"
                   Text="poiuytreza"
                   HorizontalOptions="Center"/>
        </Grid>

        <Grid Grid.Row="5" ColumnDefinitions="*, 4*, *">
            <Button Grid.Column="1" Text="Categorie" FontSize="Medium" />
        </Grid>

        <Grid Grid.Row="7" RowDefinitions="auto, *, *" ColumnDefinitions="*, auto, *">
            <Label Grid.Row="0" Grid.Column="1" Text="  Paiment par carte &#x0a;4859 **** **** 9985" VerticalOptions="Center"/>
            <BoxView Grid.Row="1" Grid.Column="1" HorizontalOptions="FillAndExpand"
                 HeightRequest="1.3"/>
            <Label Grid.Row="2" Grid.Column="1" Text="En date du 15/06/2023"/>
        </Grid>

        <Grid Grid.Row="9" ColumnDefinitions="*, 4*, *">
            <Button Grid.Column="1" Text="Faire opposition"/>
        </Grid>
        
    </Grid>-->

    <VerticalStackLayout VerticalOptions="Center">
        <Label
            Text="{Binding Sum, StringFormat='{0} €'}"
            HorizontalOptions="Center"
            TextColor="{Binding Type, Converter={StaticResource bool2ColorConverters}}"
            FontSize="Large"
            Margin="0, 0, 0, 20"/>

        <Button
            Grid.Column="1"
            Text="{Binding Category}"
            FontSize="Medium"
            Margin="0, 50, 0, 50"
            Clicked="Categ_Clicked"/>

        <Grid RowDefinitions="auto, *, auto, auto"
              ColumnDefinitions="*, auto, *"
              Margin="0, 50, 0, 50">

            <Label
                Grid.Row="0"
                Grid.Column="1"
                HorizontalOptions="Center"
                Text="{Binding InvolvedAccounts.Name, StringFormat='Paiment expédié   Compte {0}'}"
                VerticalOptions="Center"/>

            <Label
                Grid.Row="1"
                Grid.Column="1"
                HorizontalOptions="Center"
                Text="{Binding InvolvedAccounts.IBANHide, StringFormat='{0}'}"
                VerticalOptions="Center"/>

            <BoxView
                Grid.Row="2"
                Grid.Column="1"
                HorizontalOptions="FillAndExpand"
                HeightRequest="1.3"
                Margin="0, 5, 0, 5"/>

            <Label
                Grid.Row="3"
                Grid.Column="1"
                Text="{Binding Date, StringFormat='En date du {0:MM/dd/yy}'}"
                HorizontalOptions="Center"/>

        </Grid>

        <Button
            Text="Faire opposition"
            Margin="0, 50, 0, 0"
            Clicked="Objection_Clicked" x:Name="oppose"/>

    </VerticalStackLayout>

</ContentPage>