The calling thread cannot access this object because a different thread
owns it. Even after using dispatcher
In WPF I have this code
wrapPanel.Dispatcher.Invoke(new Action(() =>
{
wrapPanel.Children.Add(myCanvas);
}));
When i run this i get
"The calling thread cannot access this object because a different thread
owns it"
. As i know calling dispatcher.Invoke() should solve this problem. Why am
i getting this error? What are the possible reasons for this?.
Since my actual code is too long i didn't paste it all here. By the way
i'm a noob.
No comments:
Post a Comment