Multiple SmartParts containing Workspaces

Topics: CAB & Smart Client Software Factory
Nov 25, 2006 at 6:18 AM
originally posted by: hmoeller

I'm pretty sure that I miss something really basic...

I've got a SmartPart, i.e. a UserControl, containing a DeckWorkspace. This SmartPart is ment to be added to a SandDock TabbedDocumentWorkspace. Thus it obviously is created and added to that Workspace multiple times from within the same WorkItem. This leads to a naming conflict because the ControlSmartPartStrategy automagically registers each Workspace found in a SmartPart with the corresponding WorkItem - using the component's name as the id, which obviously is always the same for all those SmartParts.

I worked around this issue by removing the Workspace from the WorkItem's Workspaces collection an readding it using a unique id. But I cannot really believe that this is the way to go.

If I could, for example, access the SmartPart's id from within it's own constructor, e.g. by injecting it, I could rename the Workspace before the ObjectBuilder registers it with the WorkItem. But I wasn't able to figure out how this could be done.

Any ideas?
Jan 5, 2007 at 12:39 AM
originally posted by: RobertEwen


try to think about your workitemdesign. In this case it should be an idea, to create an own workitem.
This smartpart is probably an own use case and therefore predistinated to be an own workitem...

kind regards