multithreading - WPF: Problems with CurrentDispatcher.CheckAccess and CanExecuteChanged -
sometimes when call raiseevent canexecutechanged(sender, eventargs.empty)
ground thread give me exception stating "the calling thread cannot access object because different thread owns it."
however, if call system.windows.threading.dispatcher.currentdispatcher.checkaccess
returns true.
what doing wrong?
private sub m_parent_propertychanged(byval sender object, byval e propertychangedeventargs) handles m_parent.propertychanged if system.windows.threading.dispatcher.currentdispatcher.checkaccess raiseevent canexecutechanged(sender, eventargs.empty) else end if end sub
application.current.dispatcher.checkaccess()
Comments
Post a Comment