tag:blogger.com,1999:blog-9991642.post7943771098621003887..comments2008-06-03T07:20:04.140-07:00Comments on ILoggable: INotifyPropertyChanged and Cross-thread exceptions...etherhttp://www.blogger.com/profile/16911611449176929088noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-9991642.post-57633696959742651882008-06-03T07:20:00.000-07:002008-06-03T07:20:00.000-07:00I was able to get this problem resolved using the ...I was able to get this problem resolved using the AsyncBindingList and then adding an override for OnListChanged:<BR/><BR/>protected override void OnListChanged(ListChangedEventArgs e)<BR/> {<BR/> if (this.executeSynchronously)<BR/> {<BR/> base.OnListChanged(e);<BR/> }<BR/> else<BR/> {<BR/> DataTransaction tr = new DataTransaction(DataOperationKind.ListChanged, e, -1);<BR/> this.syncContext.Send(this.updateCallback, tr);<BR/> }<BR/> }Leenoreply@blogger.comtag:blogger.com,1999:blog-9991642.post-45568102374985288942008-01-30T17:31:00.000-08:002008-01-30T17:31:00.000-08:00You could also extend each control property (such ...You could also extend each control property (such as Text) you want to be ThreadSafe. i.e new TextBox.Text property... someting like set{ if(InvokeRequired){ (MethodInvoker)delegate{...}; }else{ base.Text = value;}<BR/><BR/>This is the cleanest way I can think of.tom delofordnoreply@blogger.comtag:blogger.com,1999:blog-9991642.post-60946590700471151842008-01-18T11:01:00.000-08:002008-01-18T11:01:00.000-08:00I'm exploring options other than the AsyncOperatio...I'm exploring options other than the AsyncOperation because I tend to get a lot of IndexOutOfRangeExceptions if the indexes of the business objects in my list change.Paul Koanuihttp://www.blogger.com/profile/18188902040581238344noreply@blogger.comtag:blogger.com,1999:blog-9991642.post-34199973726630808572007-11-04T20:47:00.000-08:002007-11-04T20:47:00.000-08:00It's a pain, but, I think the way to do it is to u...It's a pain, but, I think the way to do it is to use AsyncOperation and AsyncOperationManager. Using these you can post/call a method on the UI thread and you don't need any UI related code. I've used this in the past for triggering events in a background process that are handle on the UI thread or not.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-9991642.post-24142016822020577932007-08-06T07:42:00.000-07:002007-08-06T07:42:00.000-07:00Thanks for the article, most useful. What about us...Thanks for the article, most useful. What about using a custom TypeDescriptor for your proxy class? That can intercept component calls for property lists, and then you can register a custom PropertyDescriptor for each property in your type. Just a thought.Steve Hornehttp://blogs.msdn.com/stevenoreply@blogger.comtag:blogger.com,1999:blog-9991642.post-29073115503095307322007-07-31T17:04:00.000-07:002007-07-31T17:04:00.000-07:00Until you pointed it out, I had not been aware of ...Until you pointed it out, I had not been aware of the SynchronizationContext class. I'll read up on it and see how to use it in conjunction with INotifyPropertyChanged. Thanks!etherhttp://www.blogger.com/profile/16911611449176929088noreply@blogger.comtag:blogger.com,1999:blog-9991642.post-80296999490262007632007-07-31T16:27:00.000-07:002007-07-31T16:27:00.000-07:00Have you thought about using the forms Synchroniza...Have you thought about using the forms SynchronizationContext and building a proxy based on that, would assume it would perform a little nicer as its a little more lightweight.<BR/><BR/><BR/>Cheers,<BR/>Luke<BR/><B><A HREF="http://www.c9.net.au" REL="nofollow">www.c9.net.au</A></B>Lukehttp://www.blogger.com/profile/10906884295446794863noreply@blogger.com