Domanda

Is it possible to load next\previous item in FlipView on demand? Lets say I display an Item and will download next one only when user press left\right button?

FlipView has Items and ItemsSource properties, but in such case I have to specify full collection of items at once instead of downloading them one by one.

È stato utile?

Soluzione

Use an ObservableCollection for the ItemsSource property on your FlipView. You can subscribe to the SelectionChanged event on your FlipView:

private void FlipView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    //
}

In this handler, you can get the current index and decide if you have to load the next item or not (i.e. if the index is Count - 1 of your collection).

Beware that when adding an item to the collection, the event will fire and your handler will be called.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top