Is there any way of finding a shared view dynamically?

May 10, 2012 at 1:46 PM

I have a view which contains a number of regions containing read-only sub-views.

I want to have an "expand" button to display the sub-view full-screen in a child window.

I'm trying to do something similar to Jeremy's post here:

where I send a message to open the child window and set the content to the shared view. In his example he's using the Router to create a non-shared view, but I want to use the shared view with the same viewmodel to just re-display the data in a bigger window.

I wanted to re-use this for multiple views, so I was hoping to discover the views dynamically via a string. Something like:

var view = Router.GetSharedView("MyView")

however router does not seem to have this ability.

I guess I can probably import all of the views I'm ever likely to need, but that doesn't make my controller very generic?

Any suggestions?

BTW it's quite possible I'm going about this the wrong way and there's some clever Silverlight trick I'm missing!





May 15, 2012 at 6:59 AM

I don't fully understand your question but since no one else has replied ...

Since you know the name of the view can't you just use the indexer off Router?

var view = Router["MyView"];