I'm trying to update the source of an image control on the UI of my WPF app.
The code runs in nano seconds when called from the UI thread. When I set the source from a background thread, it takes some 60 - 80 seconds to complete.
What is causing the delay? How do I speed it up?
This is how am changing the image source from the background thread:
this.Dispatcher.Invoke((Action)(() =>
{
catImage.Source = new BitmapImage(new Uri(fullCatURLPath, UriKind.Absolute));
}));