How to create pagination in windows 8 METRO (C# / XAML) Application? - windows-8

i want to create a pagination / paging for my listbox.
i have a list box , there will be for about 200 items showing up in my listbox ,
so i want to perform pagination on my list box and show 15 items per page , and when user presses next button it will be going to next page and when user presses previous button it will be going to previous page .
Please let me know , How can i implement this my application.
Thanks in Advance.

Here's what you are looking for:
Discussion:
http://social.msdn.microsoft.com/Forums/en-AU/winappswithcsharp/thread/9d3cadd3-dc95-4219-9f90-e1aae6ad25c8
DataFetchSize method
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.datafetchsize.aspx
LoadMoreItemsAsync method:
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.loadmoreitemsasync.aspx
IncrementalLoadingTrigger and IncrementalLoadingThreshold properties
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.incrementalloadingtrigger.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.incrementalloadingthreshold.aspx
You can see examples of using these here (though note that the sample was based on Windows 8 BUILD release and the apis have had some changes)
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e71b7036-4fb7-4963-a65d-5bcb9fd8f664
and take a look at Hamid's BUILD session that discusses these here:
http://channel9.msdn.com/Events/BUILD/BUILD2011/APP-517T

Related

React native picker long list handler

I have a long list of company names need to be displayed in the picker dropdown and it's causing the app to freeze. I am aware of the infinite scroll if it's viewing the content, where you fetch a limited size of the data from the server side and load more as the scroll reach to the bottom. But does it apply the same concept for a dropdown picker?
I am using the library #react-native-picker/picker and considering the behavior of the component I have no idea how to handle it.
I haven't done anything on my codes yet. Currently it's fetching all the listing from the server side and dump all the data in the picker.
usually it's best practice for large select list to create a modal screen which open up by clicking on the selectbox and there you provide a search box on top and show list using FlatList as it's good for large set of data and will not freeze your screen while rendering.
Check out this
This issue 2850 mentioned something may help you and to be clear there was a solution mentioned by M1K3Yio
please check the code using react-window in this link !!

ListView with backward forward navigation and limited elements

In Sencha, how to create a DataView or List component which renders only 1 item at a time and contains prev/next buttons to navigate data?
Store has pagination enabled to pull only 5 records at a time. Out of these 5 records I want to display only 1 record at a time on the view and with navigation buttons to move forward/backwards. Is there a built-in component for this requirement?
I see few SO posts (Sencha Touch limit number of items in list) suggesting to use 2 stores (DisplayStore to slice the actual data). This didn't work for me. I tested this with static data in the actual store. It still renders all the data in the list. Moreover I am looking for forward/backward navigation buttons too.
If there is no such built-in component (at least close enough), I want to create one for my needs. Please suggest.
You should go with a filter, and two buttons.
The handler for the next button could be alike
var number= list.getStore().first().getId()
list.filter('id', number+1)
If there is anyway to increase a number for the next valid item. Otherwise you need a counter of your current selected item and increase that.

Dynamic Navigation in a XAML Windows Store App

I’m just looking for a sanity check before I go down this road with my Windows Store App.
In the app, I am looking to have a navigation model which involves the following:
All users shown the initial page, and are asked to make a section of Items from a list before tapping continue.
Each Item has a group of pages associated with it – could be 2,3, whatever.
The user is then presented the pages in the order that they are associated with for each Item and in the order by which they selected the Items.
For example, say the user selects Items 2 & 3.
Item 2 has PageA, PageB, PageC associated with it
Item 3 has PageB, PageD, PageA associated with it.
The user journey for the App would be
Selection -> PageA -> PageB -> PageC -> PageB -> PageD -> PageA -> End
The approach I am thinking of going with involves a “UserService” which is persistent throughout the app and stores a list of the Items the user has selected (in order)
I would then have a “PagePlayer” page which would act as a container for the pages to be displayed and this would be loaded after the user is finished with the Selection.
The player would then display all the pages in order based on the Items that were saved in the UserService.
I personally don’t want to go down this road because I know that having Frames displaying Pages etc is generally a bad idea, it could ruin the navigation history etc.
Which pages are associated with each item I would have saved to a local file of some sort and have this loaded when a new Item is set to be displayed.
The number of items are “hard coded” and have IDs associated with them.
I am familiar with Prism for WPF but unfortunately the recently released Prism for Windows Runtime does not support modularity for using a composite approach.
Apologies for general-ness of this question, I couldn’t think of another way of asking it.
Any help would be greatly appreciated!

Get selected item of ListBox on another page

I have made an application with two pages. When the user clicks an item on the listbox of the first page, the second page is supposed to show up with details about the clicked item.
I have a problem with accessing the selected item in the listbox of the first page from the second page.
How can I get this working?
You can't do that, because after navigation the first page no longer exists. You have to pass that value first:
How to pass values (parameters) between XAML pages?
Easiest way - to pass data by navigation parameter, it is just like GET HTTP method, Nokia has an example of how to do it here.
Second way - to store value in IsolatedStorage, for example in IsolatedStorageSettings , here Microsoft topic about it.

Windows 8 Grouped Items Page no content displayed

in my Windows 8 (Modern UI) App, i want to add a GroupedItemsPage. When I add it as my
main Page, everything Shows up, and the sample data of the template is displayed.
But when i want to add it as an additional page, that i navigate to through my MainPage,
the Content is not displayed. I only see the Title but now Elements at all.
Can anyone help me with this?
Can you provide some sample code? You might have mixed something up with the Databinding or the navigation.