CAL - How to define complex application layout(s) using regions

Topics: Prism v2 - Silverlight 3
Aug 20, 2009 at 10:13 PM

I'm looking into using the CAL in a Silverlight application and am somewhat confused conceptually how the shell and regions map to your physical application layout.  If you have different styles of layout in your application, I don't quite understand how you define a shell and region(s) to accomodate, or if I'm even thinking of this correctly.

For Example -

Login Screen 

A simple box in the center of a screen with a user name and password field as well a Submit button.  Since this is my starting point I imagine this needs to be the shell of the application..?

Main Application Screen 

Header - some dynamic information about the context of what you're doing

Navigation bar - buttons to navigate to different areas of the application

Main content area - an area that will gain the main benefit of the dynamic loading of moduels, it can host a large variety of different views in different ways

Footer

 

At first glance those two basic different layouts have me confused about how I should setup my shell, my region(s), etc.  Is it possible to have multiple shells that define the unique layouts in your application, or do you really just need 1 main region that injects views into the proper position when they are needed (downloading them on demand), or it is possible to have some sort of nested view layout where you can call on them as needed?

Anyone have any ideas as to how this should work conceptually? 

Any help is much appreaciated.

Thanks!

 

 

Aug 21, 2009 at 2:47 AM

Hi GolfAddict,

I'll preface this with the fact that I've only been working with prism in my project with two weeks and I am by no means an architect. But I have also pondered the same problem.

I solved it using the last suggestion you mentioned. I have a shell that basically has a full screen region. There are two modules (a full screen and a 'main application screen') that are regioned and load modules on demand. I'm not really sure of the downside of this approach other than the fact that you have a larger number of total assemblies.

However if you only have one screen (the login screen) that will follow the full screen type layout, maybe consider regionizing the shell for the main application page, make a window or some other user control region for the login screen and only show that window when the user is logging in. That approach seems a bit more 'hacked' to me but it depends on your liking.

I dunno just some thoughts.

 

 

Aug 21, 2009 at 6:26 PM

Hi

One way I can think of implementing your requirements would be the following. Once you load the application, and before create the Shell, you can prompt the user with the login screen. You can read more about that in the following threads:

Now, your “Main Appliaction Screen” is your Shell. Without knowing your application needs I would use a layout like this to distribute regions in the Shell:

You can then load the different views you require at each time in each region.

Moreover, the shell is not is not necessarily always the active window. you might have several views (each with different layout) and how the one you need. Nested views are also supported, just by having a region inside the view. You can find more on these in the following discussions:

 

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

Aug 21, 2009 at 7:11 PM
Edited Aug 21, 2009 at 7:15 PM

Thanks for the feedback guys.

The login example above was a simple scenario - but I imagine us running into more complex situations in the future, other distinct layouts w/ in the application outside of login.  I'll take a look at the links you provided Damian, thanks very much. 

Always fun to work w/ bleeding edge technologies.  I'll follow up w/ whatever I find out as well.

Sean (aka GolfAddict)