Modal View Problem

Topics: CAB & Smart Client Software Factory
Jan 24, 2007 at 9:49 PM
I want to have it that when a user clicks on a listview, it brings up a seperate modal window to allow them to edit it as opposed to allowing them to edit it in the workspace. I have found very little at all on Modal windows, and the only walkthrough/quickstart that does anything like what I want to do is the Appraiser Workbench, but that uses ShowDialog, which I don't have access too. Here's the code I pieced together from the little I could find:

MyView child = WorkItem.SmartParts.Get<MyView>("MyView");
if (child == null)
child = WorkItem.SmartParts.AddNew<MyView>("MyView");


When I run it, it says "The Object reference is not set to a reference of an object". The only thing I can find that's null is: WorkItem.WorkspacesWorkspaceNames.ModalWindows null

Is there something special I need to do if I am working with Modal windows? Child gets a View, so that's definitely not null. Anyone have any ideas?
Jan 24, 2007 at 11:23 PM
Yes I stumbel over the same.
Have you build your SCSF shell without a seperarate layout ?
do so and ' WorkItem.WorkspacesWorkspaceNames.ModalWindows' return != null :-)

Jan 25, 2007 at 12:23 AM
There is a page about Modal Windows on see

Uwe Lesta
Jan 25, 2007 at 12:28 AM
The disability to edit my own post is a nightmare. Sorry
Jan 25, 2007 at 12:34 AM
These fucking editor


type it in one line <underscore> means the single character.

Jan 25, 2007 at 2:22 AM
Ahhh, do you need to actually use the smartpartinfo to generate the workspace? I guess since the root workspace has a layout already, it doesn't need it, but if you create a separate modal workspace you need to provide it with the properties it needs, which is probably why it is giving the error.

Thanks so much Uwe, I appreciate it. I've never seen this Cabpedia either, so I'll definitely take a look at that as well. Cheers!

And I totally sympathize with the lack of the edit button. This forum could definitely use some more features.

Jan 25, 2007 at 4:41 AM
When it says '// NOTE: work only 'out-of-the-box' if your generate your SCSF Shell with a seperate Layout' does 'out-of-the-box' mean outside the rootworkspace? And when it says 'if you generate your SCSF Shell "with" a separate layout' does it mean if you generate with a Infrastructure.Layout? I am not using an Infrastructure.Layout...
Jan 25, 2007 at 7:49 AM

In the wizard to generate a SCSF projet is a check box where you configure if you want to add the layout of your shell into a seperate module or not.
Do a simple test :
generate 2 SCSF projekts. the first one with this option on the second off.

As far as i know.
in the first one ( layout in a seperate module ) you can access WorkItem.WorkspacesWorkspaceNames.ModalWindows e.g. in the ModuleContoller.
in the second SCSF project WorkItem.WorkspacesWorkspaceNames.ModalWindows returns null.

Uwe Lesta