Oct 28, 2010 at 4:37 AM
Edited Oct 28, 2010 at 6:41 AM
I have a pretty basic looking "explorer style" application that I'm building in Silverlight 4 with Prism (v4 Drop 10) and MEF. The navigation style that I'm trying to support is kind of like the experience in "Sql Server Management Studio".
So, I have 4 major regions: "Shell.Header", "Shell.Navigator", "Shell.Tabs" and "Shell.Footer". The Shell.Navigator region is on the left and it contains a view with a TreeView.
The Shell.Tabs region is the main region where all the navigation shows up. There is one view that gets put into Shell.Tabs which contains it's own region named "Navigator.Details". Whenever you click a TreeView item, my NavigatorViewModel requests
navigation to show something in the "Navigator.Details" region.
That all works fine. However, views that show up in the "Navigator.Details" region may contain datagrid lists of entities that may be edited (MyItemsListView). When a user edits an item from the list, I want to open a new Item Editor view in a
new tab and activate the tab. When they save the item that is being edited, I want the original datagrid back in the "detail view" to be reloaded automatically. Previously (before navigation) I was able to get a reference to Item Editor views that
I opened because I was using my own method of locating views instead of navigation.
How can I get a reference to the resulting view from a call to RequestNavigate?
I basically need to track the activity of all Item Editor view/viewmodels that are instantiated by MyItemsListView in order to refresh the MyItemsListView editable items automatically.
Here's kinda what I wanted to do (this is pseudo-pseudo-code):
var navigatedToView = TabsRegionReference.RequestNavigate(...);
navigatedToView.GetViewModel<IEditorVM>().EditCompleted += (s,e) => ReloadEditedItem(e.ItemKey);
The Prism navigation API doesn't seem to support this at all right now. I can't even get the resulting view via the navigation callback. Any suggestions on a different way of achieving this? Should I just NOT use RequestNavigate from MyItemsListView when
opening an Item Editor tab?