public CallLogDetails(MonthlyCallReportModel monthlyCallReportModel, UserTypes userType) { InitializeComponent(); _monthlyCallReportModel = monthlyCallReportModel; _userType = userType; Lbl_Title.Text = _monthlyCallReportModel.DateFromTo; _viewModel = new CallLogDetailsViewModel(); BindingContext = _viewModel; listView.ItemsSource = _viewModel.CallLogs; listView.ItemSelected += (sender, e) => { if (((ListView)sender).SelectedItem == null) { return; } FifteenCallModel selectedCall = ((ListView)sender).SelectedItem as FifteenCallModel; //DisplayAlert("Item Selected", selectedCall., "Ok"); Navigation.PushAsync(new CallInfo(selectedCall)); ((ListView)sender).SelectedItem = null; }; listView.ItemAppearing += ListView_ItemAppearing; }
public async Task OnItemAppearingAsync(FifteenCallModel callModel) { var itemIsLastVisible = callModel == CallLogs.Last(); if (itemIsLastVisible) { // oldest calls are in the bottom - load more oldest calls var paginationInitialDate = callModel.CreatedDate; await LoadData(paginationInitialDate, _minDay, _maxDay, _userType); } }
public CallInfo(FifteenCallModel call) { InitializeComponent(); _viewModel = new CallInfoViewModel(call); this.BindingContext = _viewModel; }