简体   繁体   中英

Displaying infinite Items in a Listbox control (XAML Windows Phone)

I am making an E-Shopping app for Windows Phone platform. I'm stuck at a place where I need to display all the Search result Found after user input has been recorded. The issue arising is that , only the Products of the 1st Search Result page(as in the Website) get displayed. I need to load and display all the Products of the search term.

You can check the XAML CODE I'm using in the following link, and please tell what I need to add in it to display ALL the results instead of being limited to 1 page only.

http://social.msdn.microsoft.com/Forums/en-US/4a85be6c-5e46-4815-8163-931d1584e363/load-infinite-items-in-a-listbox?forum=wpdevelop

You should use LongListSelector as ListBox depreciated.

Here is an explanation of How to create Infinite Scroll in a LongListSelector.

Basically you will be adding a definite number of items in LongListSelector as the user scrolls down to the end of the list.

Did you check your xml/json response that the items on the Page 2 is downloaded to your app? I think you are missing out some params in your web api call.

Because In general, a web api call doesnot provide all items at once, only we have to fetch in some pattern continiously.

You can achieve that using LongListSelector ItemRealized Event. Here is a detailed sample, I checked its perfectly working

http://www.damirscorner.com/InfiniteScrollingWithIncrementalLoadingInWindowsPhone8.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM