Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm developing related FaceBook Application using WPF,C#.

and I developed to receive photo through Facebook API(graph.facebook/{album id}/photos).

But I want to receive async and update ListBox in WPF.

So I totally want to know how I can update ListBox in WPF using Task Class.

please, help me.

share|improve this question
    
learn Func<T> msdn.microsoft.com/en-us/library/bb549151.aspx –  JSJ Jun 27 '13 at 10:43
    
You should post some code... –  jure Jun 27 '13 at 11:20

1 Answer 1

This should get you started ...

var dispatcher = Dispatcher.CurrentDispatcher;
var loadTask = new Task( () =>
    {
        Image image = YourMethodThatLoadsImagesFromFB();
        if ( dispatcher.CheckAccess() )
        {
            YourMethodWhichProcessesReceivedImages( image );
        }
        else
        {
            dispatcher.BeginInvoke( YourMethodWhichProcessesReceivedImages, image);
        }
    } );
loadTask.Start();
share|improve this answer
    
thanks for answer. But I can't apply to my application using your comment. if you are Ok. please can you make simple example? just add image to itembox using your comment. I'm trying to apply to my application. thank you –  user1429883 Jun 28 '13 at 1:17
    
Busy now but will try to get to this over the wkend. Can you post a snippet of your code which loads from the FB API? –  KornMuffin Jun 28 '13 at 13:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.