Whole Page Scrolling To MainRegion View Content Problem

Topics: Prism v2 - Silverlight 3
Oct 19, 2009 at 8:42 PM

Hey guys, I have a reasonably simple Silverlight layout that basically consists of a 2 row grid for the shell, the top row being 100 pixels high and basically containing the header row and the second filling the remaining space and containing the mainRegion in which to load my views.  I wrap everything in a ScrollViewer.

I would like to enable my shell to scroll (like you would scroll on a webpage, up and down the ENTIRE app) when the content of the view filling the main region is larger than the whole screen can cope with.  When I set up a test app in which I place a UserControl into the second, content row then scrolling works as expected.  However, when I reproduce this layout in my PRISM app, when I resize the browser window it basically crushes up the bottom row/main content region and no scrolling occurs at all.  I have tried various different methods of laying this out, DockPanels, StackPanels, Grids and the effect is always the same, it's like the shell doesn't care about whatever is in the main region and is happy for it to disappear when the browser is sized down.  I basically have the following layout in the shell:

        <DockPanel LastChildFIll="True">
           <Grid (Header Grid) />
           <Grid (ContentGrid)> 
                 <ItemsControl (MainRegion - Views Loaded In Here) />

As I've said, the above works fine if I replace the ItemsControl with a straight UserControl that emulates the view that will be loaded in, full page scrolling works fine.  I've tried all combinations of lengths heights no lengths no heights stretches and I've tried templating the ItemsSource as a DockPanel as suggested in another thread but cannot for the life of me get scrolling working how I want it!

Am I missing a trick here?  Is there a bug with the way Silverlight handles the content of a region once it has been loaded in?

Any help would be VERY greatfully received as this is currently driving me nuts!

Thanks in advance,  James.