view injection and storyboard

Topics: Prism v2 - Silverlight 2
Jun 9, 2009 at 10:47 AM
Edited Jun 9, 2009 at 12:22 PM


I want to do something similar to the View Injection quickstart tutorial. I have a list of Employees in a datagrid and I when I select one I should be able to view the details in a different view.

However when an employee is selected from the grid I want the grid to be replaced by the view showing the details with a nice transition, like the one that happens in the StockTraderRI when switching between Position and Watch List. But I can't figure out how to do it. I don't want the view showing the list of Employees to be destroyed when switiching to details view.

Should I create a single view with two diffent states ? Or should I switch between two views in the same region ? In which case how do I animate them ?


On the same topic, I can't figure out where is the code that switches betwen Postion and Watch list. I can't even find where this view (the rounded blue rectangle) is in the project, it's a real mistery to me !


Jun 9, 2009 at 7:57 PM

Hi graphicsxp,


I will try to answer your questions separately:

1.       The StockTraderRI implements an extension to the Silverlight TabControl to enable the animation for the transitions. You might find the AnimatedTabControl class in the Shell project inside the Controls folder.
The storyboard and it's trigger is defined in the generic.xaml file, inside the Themes folder.

2.       Prism does not provide any special support for animations, so to animate your regions and views you might use all the Silverlight resources and features. The StockTraderRI might be a very good starting point. There was been some discussion about relatated topics that might be interesting:

·         How to do animated view change

·         storyboard to animate regions in the shell  


3.       Regarding the lifetime of your views, it will be managed by the region. If you use an TabControl control it will be mapped to a region which maintains a reference to all its views. If you want to remove a view from a region, you should use the remove method.


Hope it helps!


Matias Bonaventura