Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4244054
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:39:29+00:00 2026-05-21T03:39:29+00:00

This is a Windows Phone7 project. I have a few async calls in my

  • 0

This is a Windows Phone7 project.
I have a few async calls in my code, that in the end, fills up a List that is global. But my problem is, how do I know when the async jobs is done, so that I can continue in the code?
EDIT I updated the code:

 private void GetFlickrPhotos(Action finishedCallback)
    {
        Action<FlickrResult<PhotoCollection>> getPhotoCollectionCallback;
        getPhotoCollectionCallback = GetPhotoCollection;
        flickr.InterestingnessGetListAsync(getPhotoCollectionCallback);
        finishedCallback();
    }

    private void GetPhotoCollection(FlickrResult<PhotoCollection> photoColl)
    {
        PhotoCollection photoCollection = (PhotoCollection)photoColl.Result;

        foreach (Photo photo in photoCollection)
        {
            flickrPhotoUrls.Add(photo.MediumUrl);
        }           
    }

    private void Grid_Loaded(object sender, RoutedEventArgs e)
    {
        GetFlickrPhotos(() =>
        {
            int test = flickrPhotoUrls.Count;
        });            
    }

The async calls is done using Action<T> in .net framework 4. It still doesn’t wait for the async call. Is it because the async call is done from “GetFlickrPhotos”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:39:30+00:00Added an answer on May 21, 2026 at 3:39 am

    I went for the following code, it’s working for my program. Thank you for the help!

     app.Flickr.PhotosSearchAsync(options, flickrResult =>
                {
                    if (flickrResult.HasError)
                    {                                          
                        ShowErrorImage();
                    }
                    else 
                    {                        
                        flickrPhotoUrls.Clear();
                        flickrImages.Clear();
                        foreach (var item in flickrResult.Result)
                        {
                            FlickrImage image = new FlickrImage();
                            image.ImageOwner = item.OwnerName;
                            image.DateTaken = item.DateTaken;
                            if (item.Title == string.Empty)
                            {
                                image.ImageTitle = "Untitled";
                            }
                            else
                            {
                                image.ImageTitle = item.Title;
                            }
                            image.SmallUrl = item.SmallUrl;
                            image.MediumUrl = item.MediumUrl;
                            image.Description = item.Description;
                            image.Latitude = item.Latitude;
                            image.Longitude = item.Longitude;
                            if (item.DoesLargeExist == true)
                            {
                                image.LargeUrl = item.LargeUrl;
                            }
    
                            flickrImages.Add(image);
                        }
                        ShowPhotos();
                    }                    
                });
    

    This way, I call the method ShowPhotos() when the Flickr call is finished.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a Windows Phone 7 project I'm using XAML that looks like this; <phone:PhoneApplicationPage.Resources>
I have a windows phone 7 project with a page that has the following
I have a MonoTouch project using some code I share with a Windows Phone
So I run this Windows Server 2008 security update and this code block is
I'm developing a project for windows phone 7. It's very simple I guess but
We have a Service that continuously collects sensor data on the phone. This service
Intro We have a project to design and implement this semester. For our project,
In a Windows Phone project I have the following scenario: The user types some
I have a sample windows phone 7 project where I test some MVVM stuff,
I have a structure like this WebUI project - controllers, views Framework project- repositories,service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.