<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Banquale.Views.Balance.BalanceView">
    <VerticalStackLayout>


        <ListView ItemsSource="{Binding TransactionsList}"
                  SelectionMode="None">

            <ListView.ItemTemplate>

                <DataTemplate>

                    <ViewCell>

                        <Grid
                            ColumnDefinitions="40, 3*, *"
                            Margin="20, 5, 20, 5"
                            HorizontalOptions="Fill">

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

                            </Grid.GestureRecognizers>

                            <Label
                                Text="{Binding Id}"
                                Grid.Column="0"
                                x:Name="transactionId"/>

                            <Label
                                Text="{Binding Date, StringFormat='{0:ddd dd MMM yyyy}'}"
                                Grid.Column="1"
                                VerticalOptions="Center"
                                Margin="10, 0, 0, 0"/>

                            <Label
                                Text="{Binding Sum, StringFormat='{0} €'}"
                                Grid.Column="2"
                                VerticalOptions="Center"
                                HorizontalOptions="End"
                                Margin="0, 0, 20, 0"/>

                        </Grid>

                    </ViewCell>

                </DataTemplate>

            </ListView.ItemTemplate>

        </ListView>

    </VerticalStackLayout>
</ContentView>

