Topics: CAB & Smart Client Software Factory
Sep 6, 2005 at 11:00 PM
originally posted by: rpocklington

Does anyone know how to get Events at WorkItem scope to work?

I have a UserControl that I want to host 2 smart parts on, and have the two 'communicate' through the EventBroker. I would like the events to be visible only within this workItem.

I have created a UserControl (called MainView), placed a Splitter control onto it, and placed a SmartPartPlaceHolder into each of the panels (called "LeftSide" and "RightSide"). The two smartparts are called 'FirstView' and 'SecondView'. In the Run method of the workItem class, I have the following code to load up the smartparts:

Public Sub Run(ByVal workspace As IWorkspace)

Create(Of FirstView)("LeftSide")
Create(Of SecondView)("RightSide")

mainView = Create(Of MainView)()


End Sub

I would like an event that originates from the firstView to be captured by the secondView smartpart. Is it possible for the event subscriber to be located within the code of the seconfView smartpart? I can get it to work if I use EventScope.Global, but I want to be able to do it with EventScope.WorkItem.


Robert Pocklington