Display view within a region conditionally

Topics: Prism v2 - WPF 3.5
Apr 27, 2010 at 4:37 PM
Edited Apr 27, 2010 at 4:38 PM

Hi,

Is it possible to Display views within a region conditionally?

e.g. the StockTrader Reference, when the POSITION tab is selected, I would like to display something within the right hand side sidebar region. When the Watchlist tab is selected, I would like to display something else within the right hand side sidebar region.

Is this possible?

Thanks

Apr 27, 2010 at 7:45 PM

Hi, Yes is it possible. Most of the samples show that you register the view with the region when the Module's initialize method execute. You don't need to this this in this method. You can access the regionmanager and the view from unity container from your controller class, and manually register the view into the region based on your logic. See the ViewInjection example (not viewdiscovery).