I have a TabWokspace on the shell window. A particular workItem shows a SmartPart on the TabWorkspace. When I select the tab page containing that smart part, the activation service activates the workitem that contains the TabWorkspace. I don't know if
this is by design, but this behavior is not the desired behavior. I need that when I select the tab page, the activation service (or whatever) activates the workitem that contains the smart part contained in the tab page.
The scenario is the following:
The application is pure WPF SCSFContrib .
One toolbox on the shell window. Each button on the toolbox has an associated command.
One TabWorkspace on the shell window.
The tab workspace may contain serveral tab pages. Each tab page shows a smart part which is contained by different workitems, say TabPageA shows SmantPartA from WorkItemA and TabPageB shows SmartPartB from WorkItemB.
When a WorkItem is activated, I enable or disable the commands based on if the command execution has sense or not for the active workitem. This logic is done by the work item itseft.
Work items have command handlers. The command handlers check whether the work is active or not, if the work item is active, the command handler peform the expected job otherwise do nothing.
This pattern does not work because work items do not activate properly. When I select a tab page on the tab workspace, the workitem containing the smartpart shown on the tab page should be activated, but it do not, instead, the workitem containing the tab workspace
Is this a bug?
Is this by design?
Should the activation service logic be changed?
Shoud the TabWorkspace logic be changed?
How can I activate the workitem containing the smart part shown on the tab page when the tab page is selected?
How can I tell which workitem contains a specific spart part?
Should I redesign the application?