Multiple Views

Topics: Prism v2 - WPF 3.5
Apr 7, 2009 at 12:29 AM

I am new to Composite WPF so learning curve has been steep - hopefully someone can help offer some help/advice;

Fooling around with DX Carousel to view varying amounts of images pulled off a server. I have an RasterItemModule which contains view, services, presentationModel etc for converting and loading images into viewer. I also have a CarouselModule which contains the CarouselView - this consists of CarouselItemsControl which I presume is of type ItemsControl. What I cannot work out is how to get the RasterItem views  into the carousel view ie where would I put the region name for each item view? Also - I assume I will need to create a scoped region for every image pulled off the server and use something like the filename to name each region? Lastly - is a controller the best place to do all this view injection?

Thanks in advance

Apr 7, 2009 at 8:52 PM
So, to be clear, you're trying to inject views into a carousel?  And the carousel contains images?  What else is contained in the views? 
Apr 7, 2009 at 9:20 PM
The RasterItemModule contains a view. The view consists of 3rd party image viewer control and the module has all services for image loading and conversion etc. The view only contains an image - just for navigation and display.
The CarouselModule has it's own view which contains the CarouselItemsControl and nothing else - really basic for now.
So I am assuming that I need to create a RasterItemModule for each file held on server and this would require the use of scoped regions?
I also need to work out where or how to create a region name (if possible) so that the views created above will display in carousel?

Apr 8, 2009 at 5:16 PM

Hi Kern,


Though I don't know your exact scenario, I think best way to get RasterItem views into the carousel view is using View injection, so that you can load Raster views at different times.

To keep modules loosely coupled a good place to put this view injection logic would be the RasterItemModuleController. These will be the class that will know how to retrieve images from the server and create RasterItem view, so once it's done it can inject that view into the corresponding region. You might find usefull the UI Composition design concept from the documentation.


I think that it won't be necessary to create scoped regions for each image. In general the RegionManager acts as a locator, used by external modules to be able to find UI containers defined on other modules in a loosely coupled way (in this case RasterItem module will locate the Carousel region to inject each image).  So, unless other modules need to find images and use them as container for other views, you don't have to associate a region for each image.



Hope it helps!


Matias Bonaventura


Apr 9, 2009 at 12:22 AM
Hi Mattias;

Thanks for reply - getting there slowly but I think I have not explained fully (typical)

For example;
There are 10 images sitting on server - but the amount is dynamic throughout the day;
My thinking so far has been this:
I need to create a seperate RasterItemView for each image as each view will contain a Leadtool image viewer control for viewing a single image;
Each view then needs to be registered in a region within the CarouselModule which contains the Developer Express carousel control;
From my limited understanding of XAML and WPF this control is of type ItemsControl - so I think I need each item to have a region to allow
each view to be injected into?

Thanks for patience and help so far