Hi,
I have an BitmapFrame object created by a working thread (not UI thread) and placed in a static collection.
then, I have a different working thread assigning this object to an Image object owned by the UI thread.
As you can imagine, I can't access the Image object (As it belongs to the UI thread) and I get: "calling thread cannot access the object because different thread owns it"
So, I tried solving it by doing the following:
imageMainImage.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action<ImageItem>(delegate(ImageItem A) {
imageMainImage.Source = A.ManipulatedPreview;
}), II);
II is the Image item (created by a working thread and available through a static class) and imageMainImage is the Image object owned by the UI thread.
But now, again, I get the "calling thread..." but this time I get it because the II object belongs to a different thread (the first working thread).
What I'm trying to do is have one thread work with 2 image elements that belong to different threads.
I'm trying to work the whole process differently but was wondering, is there a solution to this?
thanks.