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 6220081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:53:44+00:00 2026-05-24T07:53:44+00:00

In windows phone 7 I’m doing a simple async lookup to find an image

  • 0

In windows phone 7 I’m doing a simple async lookup to find an image by uri and set the returned binary as the source for an image control.

public object SetImageFromUri(string uri)
{
    var wc = new WebClient();
    wc.OpenReadCompleted += new OpenReadCompletedEventHandler(wc_OpenReadCompleted);
    wc.OpenReadAsync(new Uri(uri), wc);

    return null;
}

void wc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
    if (e.Error == null && !e.Cancelled)
    {
            var image = new BitmapImage();
            image.SetSource(e.Result);

            //e.Result has a property in the memory stream labeled finalUri
            //someImageControl.Source = image;

    }
}

My question is- how can I pull out the final uri property from the e.Result so I can see what image control it’s associated with

Thank you in advance

  • 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-24T07:53:45+00:00Added an answer on May 24, 2026 at 7:53 am

    Instead of passing the WebClient through as the second parameter, pass the Uri (or some other piece of usefule state information)

    wc.OpenReadAsync(new Uri(uri), uri);
    

    You can then access this in your callback

    var uri = (string)e.UserState;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Windows Phone 7.5 Silverlight app I want to let the user drag the image
In Windows Phone 7, a textbox with IsReadOnly property is set to true, when
i am developing windows phone 7 application.how to set reminder functionality in 7.0? can
Windows Phone 7 App The Goal of the application is a simple To Do
On windows phone 7 pivot control template project, the pivot control page doesn't remember
In windows phone 7 ,is there any combo box and table view control. If
Windows phone asks for specific image sizes when submitting an application. When I take
Windows phone user can set timezone or set automatically option on settings->datetime section. I
Windows Phone 7.1: How to add/delete items from LongListSelector control? I am using a
with windows phone 7 i am using teh bing map control. i have it

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.