This project has moved. For the latest updates, please go here.

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: http://csharperimage.jeremylikness.com/2011/10/using-jounce-navigation-to-create.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+CSharperImage+%28C%23er+%3A+IMage%29

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"];