Binding problem

Topics: CAB & Smart Client Software Factory
Dec 16, 2006 at 1:35 PM
originally posted by: ovidius

Following the examples in the HOL i wrote a little application that works in the same way.
I notice that the when i click on a customer in the customer listbox it creates a workitem that contains all the view for customer detail.
OK, but if i change a property in the customerdetail workitem it dosen't reflect in the listbox since it live in another workitem, so i'm askin how to implement a bindingsource through different workitems.
Maybe the response is trivial, but for now i didn't find valid solutions.
May i use a bindingsource directly in the main workitem and access to it from the controller?
Thanks
Dec 19, 2006 at 7:00 AM
originally posted by: techtickler

Yes, you can set a State"MySource" in RootWorkItem and assign/change value of it in any child workitem. Then if any workitem's view wants to reflect the chnage, subscribe to StateChanged event in child workitem's controller to update its own view.
Dec 20, 2006 at 8:34 AM
originally posted by: ChrisHolmes

"May i use a bindingsource directly in the main workitem and access to it from the controller? "

Sure, you can. But I wouldn't. I asked this question of Brad at the P&P Summit this fall, and like he said, then you're basically comitting your view to databinding, which other implementations of your view interface may not wish to do.

Personally, we use EventBroker for this sort of update-communication process. If we have multiple views observing an object, then we use EventBroker events to handle the update in a publish/subscribe pattern. If one view updates the model then it calls the EventBroker event, and the listening views elsewhere in the WorkItem fetch the latest version of the model.

We don't use State or the StateChanged event - we've discovered some difficulties with that...
Dec 20, 2006 at 10:25 AM
originally posted by: ovidius

Thanks Chris.
Eeffectively is correct.
Jan 5, 2007 at 6:45 AM
originally posted by: pyhavaim

We don't use State or the StateChanged event - we've discovered some difficulties with that...

Could you specify those difficultes, beacause we're using this quite heavily...
Maybe we should also reconsider, so please give some examples of this