Search code examples
silverlightauthenticationwindows-phone-7http-authentication

WP7 set Image to source behind a HttpBasicAuthenticator


i am trying to set an image in a Windows Phone 7 App, there is a problem thoug, the url where the image is located required Authenticator, i have a valid username and password, but i have no idea how to load the image thoug an URI with the Authenticator?

        ProfileImage.Source = new BitmapImage(new Uri(userObject.ProfileImage));

Solution

  • Unless you can use a authentication url, ie. http://username:password@domain.tld/image.png then you need to download the image locally first, and then load it afterwards.

    You could write a custom handler for it, that downloads it to the Isolated Storage, and then automatically updates the UI, while using a fallback image (typically blank) while loading it.