WPF Threading issues
Exception Thrown "The calling thread cannot access this object because a different thread owns it".
When hooking up Images using a MVVM pattern and background threads this
Exception Thrown "The calling thread cannot access this object because a different thread owns it".
Use Image.Freeze() command to prevent this.
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/5975d3f5-9771-442f-a11e-183b4969e38d/
Again MVVM this time button does not update its valid state following a background thread.
Normally the WPF infrastructure updates every command`s enabled/disabled state but in this case need to refresh the command`s enabled/disabled state manually.
Use InvalidateRequestQuery.
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/d2cf8ff9-eecd-40ec-b3a1-c8c8e39378d9
This is a added to the event subscriber in the MV
Application.Current.Dispatcher.BeginInvoke(new Action CommandManager.InvalidateRequerySuggested));
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment