DeckWorkspace within a TabWorkspace?

Topics: CAB & Smart Client Software Factory
Jul 19, 2006 at 2:52 PM
originally posted by: MJMaster

I am trying to get a DeckWorkspace working within a TabWorkspace and cannot get more than a single view to display. I have a Layout view that contains the DeckWorkspace and by debugging I can see that both views are loaded, but I can never get more than the first view to display within the contained DeckWorkspace.

Has anybody tried this or have any hints/ideas?

Thanks in advance...
Jul 19, 2006 at 11:36 PM
originally posted by: DapinderSingh

Try this :

Create a DeckworkSpace as _deckWorkspace and add it initially in the workitem at load time using :

public Layout(WorkItem workItem, IWorkItemTypeCatalogService workItemTypeCatalog)
workItem.Items.Add(_deckWkspcTeller, "TellerDeckWorkSpace");


In the ModuleController (if u are using SCSF) of the same module, in AddView() function, add the following code
where <TellerView> and <CutomerInfo> are my user controls which i want to load on the deckworkspace

Now on the function click where you want to show <TellerView> control, add the following code:

DeckWorkspace _deckWorkSpace = (DeckWorkspace)WorkItem.Workspaces "TellerDeckWorkSpace";

SmartPartInfo _SPInfo = new ZoneSmartPartInfo("TellerView");
object _smartPart = WorkItem.Items.Get<Teller>("TellerView");
_SPInfo.Dock = DockStyle.Fill;
deckWorkSpace.Show(smartPart, _SPInfo);

In the function call when you want to display <CustomerInfo>("CustomerInfo"), do the following code

DeckWorkspace _deckWorkSpace = (DeckWorkspace)WorkItem.Workspaces"TellerDeckWorkSpace";

SmartPartInfo _SPInfo = new SmartPartInfo("CustomerInfo");
_SPInfo.Dock = DockStyle.Fill;
object _smartPart = WorkItem.Items.Get<Module2.CustomerInfo>("CustomerInfo");
deckWorkSpace.Show(smartPart, _SPInfo);

Do not hide any of the control, always the active control will be displayed.

This works perfectly fine for me. Please tell me in case this works (or dosen't :-) )