WP7 - Paging effect on a single view
Before I begin, I'm no SL or WPF master, so I need some guidance. What I have is a List<CustomObject>
. I then have a view that I can bind a "CustomObject" to and have all the data displayed. Now to keep intack with the Metro guidelines and Navigation guidelines, I want to be able to use the SL Control Toolkit Gesture Service to detect a flick (this part is done and working). When I flick left, it binds current list position -1 when I flick right is binds current list position + 1.
Now, I need to make it pretty. I'd like it to behave similar to the pivot control, as when I hold down, it moves the grid to the left and when the full flick is created it slides away to the left or right and loads the the next item.
These lists can have 100's of items, so dynamically adding them to a Pivot control isn't an option.
I know I have to capture the OnDelta and start moving the grid, but I'm really trying to find a sample that's similar to what I'm looking for to give me all the peices. There used to be a few custom implementations of the Pivot and Panorama control but I can't find them.
Any ideas that can point me to the right place?
Tha开发者_StackOverflow中文版nks!
Because you need to create multiple instances of whatever displays your CustomObject I would consider using a Pivot control with three items in it. The three items should be the current item and the ones either side of it.
As the user navigates between items update the DataContext/Binding of the other items so they reflect the itesm next to the one currently displayed. (You'll only need to set one at a time.)
I've used this technique successfully in apps where each page wasn't excessively complicated to load. (When it was there was a lag when navigating quickly between items.)
精彩评论