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) 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)) //if (string.IsNullOrWhiteSpace(idLabel.Text))
//{ //{
@ -35,9 +41,9 @@ public partial class BalanceView : ContentView
//Mgr.SelectedTransaction = transaction; //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"> HorizontalOptions="Fill">
<Grid.GestureRecognizers> <Grid.GestureRecognizers>
<!--<TapGestureRecognizer <TapGestureRecognizer
Tapped="Transaction_Clicked" Tapped="Category_Clicked"
NumberOfTapsRequired="1" />--> NumberOfTapsRequired="1" />
</Grid.GestureRecognizers> </Grid.GestureRecognizers>
<Label <Label
Text="{Binding .}" Text="{Binding .}"
Grid.Column="1" Grid.Column="1"
x:Name="transactionId"/> x:Name="categoryName"/>

@ -11,4 +11,15 @@ public partial class CategoryView : ContentView
InitializeComponent(); InitializeComponent();
BindingContext = Mgr; 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