Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Listview fill from iList not refreshing issue

$
0
0

This is my next button code. when i click next button my list is filling correct data but its not refreshing. i tried many ways to refresh it. but its not refreshing

`var btnNext = new ThemeButton
{
Text = ">"
};

btnNext.Clicked += async (sender, age) =>
{
if (Countpage != currentpage)
{
lblTtot.Text = (currentpage + 1).ToString() + "/" + Countpage.ToString();
currentpage = currentpage + 1;
}

IList<portable.ActionReturnResult> LoadPage = 
    GetPage(appBase.Results, currentpage, pageSize).ToList();

RefreshListPanel(currentpage, LoadPage.ToList());                   

};

IList<portable.ActionReturnResult> GetPage(IList<portable.ActionReturnResult> list,
int page, int pageSize)
{
return list.Skip(page-1 * pageSize).Take(pageSize).ToList();
}

private void RefreshListPanel(int curtpage,
List<portable.ActionReturnResult> ResultsPage)
{
var startIndex = 0;
var pageName = (curtpage + 1).ToString();

ListPages.Add(new PageGrid
{
    CurrentPageIndex = curtpage,
    PageName = pageName,
    Results = ResultsPage,
    RecordCount = AppBase.Results.Count,
    PageSize = 5
});

AppBase.Results = ListPages?.Count > 0 ? ListPages[0].Results : ResultsPage;
SetPageItems(ResultsPage);

}`


Viewing all articles
Browse latest Browse all 89864


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>