I would like to download Gravatar-Images and install them from code in WPF Image-Control. So the code looks like
imgGravatar.Source = GetGravatarImage(email);
Where GetGravatarImage looks like this:
BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new Uri( GravatarImage.GetURL( "http://www.gravatar.com/avatar.php?gravatar_id=" + email) , UriKind.Absolute ); bi.EndInit(); return bi;
Unfortunately, this blocks the GUI on a slow network connection. Is there a way to assign an image source and let it load an image in the background without blocking the user interface?
Thanks!
user1130329
source share