Click here to Skip to main content
15,883,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there any way to refresh or rebind a FlipView control when SelectionChanged() event is called? I want to call an async method when SelectionChanged() event is invoked. The main reason for this is to optimize the memory usage of my app. The async method should load an image exactly when user clicks on the next/previous button on the FlipView.

I tried this code:

C#
private void flipView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    MovieItem SelectedItem = ((FlipView)sender).SelectedItem as MovieItem;
    if (SelectedItem != null)
    {
        Task t = Task.Factory.StartNew(async () => SelectedItem.SetPosterImageAsync(TmdbWrapper.Utilities.PosterSize.w500));
        t.Wait();
    }
}


The main problem is the GUI does not refresh at all.
Next step would be to show a progress bar while async method is loading the image because the process can be long depending on the image size.
Posted
Updated 20-Oct-13 13:49pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900