Event publication and multiple subscription possibilities

Topics: CAB & Smart Client Software Factory
Nov 15, 2007 at 8:11 PM
Greetings again!

So, here's my dilema. I have a view that subscribes to an event generated by a button. If I have one instance of this view open, everything is fine. When I have more than one instance of this view, I start to run into problems because each view is subscribing to the event. Sometimes, I only want view A to respond (based off of criteria), and other times, I only want view B to respond. Is this something that is feasible in CAB?

Thanks in advance,

Nov 16, 2007 at 7:10 PM

One option consists of firing an event that is handled by the WorkItem controller and making the controller raise a particular event for each view depending on the criteria. Another option could be to fire the event with some criterion in the event args and let the views determine whether they have to handle the event or not.

Please let me know if this helps.

Mariano Converti
Nov 16, 2007 at 7:23 PM
Thanks Mariano. I like the concept of putting some sort of criteria in the EventArgs that will help determine which view should handle the event.

Again, I appreciate your quick response.