Hello, at first I introduce myself, I'm Martin of Argentina, is the first time I do a query in the forum. I do not write very well in English, so I apologize.
I want to see if it is feasible to help me with a problem I have.
Using C # and Wpf.
When loading an image, the first time that passes here works perfectly, the second longer. As I can clean the variables to be re-run the entire code if you pass a second time.
void LoadImageAsyn(string uri)
{
StatusPrompt.Content = "Descargando";
PreviewImage.Source = null;
bindingContext.Image = null;
TopContentArea.IsEnabled = false;
Uri u = new Uri(uri, UriKind.RelativeOrAbsolute);
BitmapImage img = new BitmapImage(u);
img.DownloadCompleted += new EventHandler(ImageDownloadCompleted);
img.DownloadFailed += new EventHandler<ExceptionEventArgs>(ImageDownloadFailed);
}
Try to fix it by adding:
img.BeginInit ();
img.CacheOption = BitmapCacheOption.OnLoad;
img.EndInit ();
But tampocome funcinó. I can provide a little of your time and give me guidance on the problem that I present.
From already thank you very much.