public BankAccountsViewModel(INavigation navigation) : base(navigation) { CustomerAccounts = new ObservableRangeCollection <CustomerAccount>(); CustomerAccounts.CollectionChanged += CustomerAccounts_CollectionChanged; CustomerCards = new ObservableRangeCollection <MyCards>(); CustomerTransactions = new ObservableRangeCollection <RefinedTransactions>(); WalletDetails = new WalletDetails(); WalletTransacttions = new ObservableRangeCollection <WalletTransacttion>(); AllTransactionsCommand = new Command(() => { var vm = new AllTransactionsViewModel(Navigation); vm.SelectedAccount = SelectedAccount; var page = new AllTransactionsView(); page.BindingContext = vm; Navigation.PushAsync(page); }); AllWalletTransactionsCommand = new Command(() => { var vm = new WalletAllTransactionPageViewModel(Navigation); vm.WalletNuban = WalletNuban; var page = new WalletAllTransactionPage(); page.BindingContext = vm; Navigation.PushAsync(page); }); SelectedAccount = new CustomerAccount(); ReloadWallet = new Command(async() => await GetCustomerWalletbyPhoneNumber(GlobalStaticFields.Customer.PhoneNumber)); ReloadAccounts = new Command(async() => await GetCustomerAccountsbyPhoneNumber(GlobalStaticFields.Customer.PhoneNumber)); }
public AllTransactionsView() { InitializeComponent(); vm = (AllTransactionsViewModel)this.BindingContext; // BindingContext = vm; if (tabView.SelectedIndex == 0) { Resources["accounts"] = Application.Current.Resources["SelectedTabviewWhite"]; } }
protected override async void OnAppearing() { base.OnAppearing(); if (vm == null) { vm = (AllTransactionsViewModel)BindingContext; } var currentMonth = DateTime.Now.Month; var currentYear = DateTime.Now.Year; var daysInMonth = DateTime.DaysInMonth(currentYear, currentMonth); var startDate = new DateTime(currentYear, currentMonth, 1); var endDate = new DateTime(currentYear, currentMonth, daysInMonth); vm.SelectedMonth = vm.Months[currentMonth - 1]; vm.MonthIndex = vm.Months.IndexOf(vm.SelectedMonth); await vm.GetAllTransactions(vm.SelectedAccount.nuban, vm.SelectedAccount.currencyCode, startDate, endDate); }
public AllTransactionsPage() { InitializeComponent(); ViewModel = new AllTransactionsViewModel(Navigation); }