Fixed bug with the selectedTransaction

pull/52/head
Titouan LOUVET 2 years ago
parent c4cd2894fc
commit b2b0f9d9bf

@ -16,7 +16,13 @@ public partial class BalanceView : ContentView
public async void Transaction_Clicked(Object sender, EventArgs e)
{
//uint TransactionId = Convert.ToUInt32(transactionId.Text);
var selectedItem = (sender as Grid)?.BindingContext as Transaction;
if (selectedItem != null)
{
Mgr.SelectedTransaction = selectedItem;
await Navigation.PushModalAsync(new TransactionsPage());
}
//if (string.IsNullOrWhiteSpace(idLabel.Text))
//{
@ -35,9 +41,9 @@ public partial class BalanceView : ContentView
//Mgr.SelectedTransaction = transaction;
Mgr.SelectedTransaction = Mgr.CustomersList[0].AccountsList[0].TransactionsList[0];
//Mgr.SelectedTransaction = Mgr.CustomersList[0].AccountsList[0].TransactionsList[0];
await Navigation.PushModalAsync(new TransactionsPage());
//await Navigation.PushModalAsync(new TransactionsPage());
}
}

@ -21,16 +21,16 @@
HorizontalOptions="Fill">
<Grid.GestureRecognizers>
<!--<TapGestureRecognizer
Tapped="Transaction_Clicked"
NumberOfTapsRequired="1" />-->
<TapGestureRecognizer
Tapped="Category_Clicked"
NumberOfTapsRequired="1" />
</Grid.GestureRecognizers>
<Label
Text="{Binding .}"
Grid.Column="1"
x:Name="transactionId"/>
x:Name="categoryName"/>

@ -11,4 +11,15 @@ public partial class CategoryView : ContentView
InitializeComponent();
BindingContext = Mgr;
}
public async void Category_Clicked(object sender, EventArgs e)
{
var selectedItem = (sender as Grid)?.BindingContext as string;
if (selectedItem != null)
{
Mgr.SelectedTransaction.ChangeCategory(selectedItem);
await Shell.Current.Navigation.PopAsync();
}
}
}
Loading…
Cancel
Save