Home > Software design >  How can I access the counter of a ListView in Xamarin?
How can I access the counter of a ListView in Xamarin?

Time:11-09

I have a Listview with binding, and I need the count of this ListView, but I found that in the property ItemSource has the count, but I can't access, Someone cans to help me?

CodePudding user response:

If you have a ListView with an ItemSource binding, you can also bind to the count of the ItemSource.

<Label Text="{Binding ItemsList.Count}"/>

CodePudding user response:

Once you set listview's itemssouce, like:

collectionlist.itemssource=itemsList;

The count of the itemslist is the count of collectionlist.itemssource.

   var num=itemsList.Count
  • Related