Window (View) manager

Topics: Prism v4 - Silverlight 4
Jan 31, 2011 at 12:09 PM

Hello everyone,

I'm now trying to figure out, if it is possible in Silverlight MVVM & Prism to do an application, where should be the user able to switch between modules, without loosing changes already made in forms.

For example we'll have two modules (both modules should open only in main region) and a navigation menu in navigation region. These two modules would be Client, AddressList.

Then I should be able to open new client, start typing, open addresslist, lookup if address is existing, which clients have the same address and then using the navigation see those three windows "clientmodule -> new", "addressmodule -> addresslist", "clientmodule -> list".


I haven't found any solution which could support that, so any help appreciated.


If not I had an idea, where I could create a temporary cache, where should be the leaving views stored onleave, and then using the navigation menu restored to original region. But still don't know if it is possible to do that. And whether it is worth it.

Jan 31, 2011 at 8:56 PM


You might use Prism Navigation. Prism supports its own navigation approach, which can work side by side with WPF and Silverlight Navigation.

You could implement the INavigationAware interface in your view models and in the OnNavigatedFrom method, which is called before navigation takes place, you can save all the data or states related to the users interactions. Here you can create a temporary storage for the user data using the UriQuery class.

Then, in the OnNavigatedTo method, you could retrieve back these data from the NavigationContext dictionary.

You can read more about Prism Navigation in the following links:

· Chapter 8: Navigation

· Prism v4 Region Navigation Pipeline (on Karl Shifflett´s blog)

Additionally, you might find handy the View-Switching Navigation QuickStart which demonstrates how to use this approach.

I hope you find this information useful.


Miguel Bronzovic