Multiple Telerik windows as views (Silverlight)

Topics: Prism v2 - Silverlight 2
Jun 3, 2009 at 3:27 PM

Hello everyone,

I have Silverlight Prism2 application that uses two regions: CustomerListRegion (ItemsControl as region) and CustomerDetailsRegion (ItemsControl as region).

I use Telerik Window Control in UserControl as a CustomerDetailsView.

CustomerDetailsView is injected by CustomerListView using view injection into CustomerDetailsRegion.

CustomerDetailsView should act as a popup window shown on-top of all other contect when customer is selected in CustomerListView.

The problem is simple: How to show multiple windows (multiple popups) in the same time in the single region?

There are few problems with this in my mind:

1.) The CustomerListView and CustomerDetailsView are in the separate modules (that is required), so I registered CustomerDetailsView with interface in unity container.

2.) I can't figure it out how to get multiple instances of the same CustomerDetailsView when resolving it from unity container (so I could inject different view into the same region)?

 

 

Jun 3, 2009 at 8:34 PM

Hi Ivan,

 

Another way to show the CustomerDetailsView when a particular customer is selected could be the following:

1.       Fire an event using EventAggregator in the Presenter/Model of CustomerListView when a new customer is selected.

2.       Handle the Event in the module that contains the CustomerDetailsView, and create a new instance of that view, based on the payload of the event (for example you could pass the customer’s ID).

 

The above steps keep the modules decoupled, because they do not use views of other modules.

 

Now that you have the view created you can create a new Telerik Window and show your view in it (I have never used this control, so I do not know how using regions with it would be, but the objective would be having a region inside it to inject the views).

 

Please let me know if this helps.

 

Damian Schenkelman

http://blogs.southworks.net/dschenkelman