Sharing Views accross Modules

Topics: CAB & Smart Client Software Factory
Oct 28, 2006 at 5:22 AM
originally posted by: m_frost

I am new to CAB and although things are comming on thanks to such news groups I am stuck with this:

I have a view (SmartPart) belonging to a module. (The first module loaded). The ModuleController adds a couple of views to the modules workitem, but with this particular view I add it to the Shells RootWorkItem.

myListView myListView = this.WorkItem.RootWorkItem.Items.AddNew<MyListView>("MyListV");
this.WorkItem.Workspaces"wsModuleOne".Show(myListView );

I have no trouble showing this view in its own module workitem on the first Show() call.
I can also show the View in another Modules workitem as I originally added the module to the RootWorkitem and have access via ID.

MyListView myListView = (MyListView)this.WorkItem.RootWorkItem.Items"MyListV";
this.WorkItem.Workspaces"wsModuleTwo".Show(myListView );

All fine so far - but now when I try to once again show the View in the First Module - it won't show even though there is no problem finding it.

this.WorkItem.Workspaces"wsModuleOne".Show(myListView );
Shows an empty WorkSpace.

Any help would be appreciated.

Mark Frost