Your first concern is to get a reference to the RegionManager. So far I know of 2 ways to get the regionmanager of your shell. Both methods will also word when you are in another view or a viewmodel. There might be other methods using MEF or other Dependency Injection systems (like Castle Windsor).
The first method assumes that you use Unity and have used an implemenation of the UnityBootstrapper. This method is descibed in the Prism4.chm file which you probably have found in Prism directory (where you did install prism). It is in Chapter 2 (Initializing Prism applications).
Once you have run the bootstrapper you can use the ServiceLocator to locate the default RegionManager (the shell uses the default RegionManager).
IRegionManager myRegionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
The second method makes it possible to get a reference to the RegionManager without using a Dependency System. This uses a cusom implementation of a RegionBehaviour. This is descibed in
http://stackoverflow.com/questions/6582612/prism-4-locally-scoped-regionmanager[
^]. Using the code in this answer you can make View and ViewModel aware of it's RegionManager.
Once you have the regionmanager you will need a reference to the region containing the 3 views.
IRegion myRegion = myRegionManager.Regions["theNameOfYourRegion"];
To get a reference to the view, you use
FrameworkElement aView = myRegion.Views.ElementAt(i) as FrameworkElement;
Putting it all together and assuming that you use code behind to handle the clickevent of the buttons, you might get something like this:
private void Button1_Click(object sender, RoutedEventArgs e)
{
ShowViewAtIndex(0);
}
private void Button2_Click(object sender, RoutedEventArgs e)
{
ShowViewAtIndex(1);
}
private void Button3_Click(object sender, RoutedEventArgs e)
{
ShowViewAtIndex(2);
}
private void ShowViewAtIndex(int index)
{
IRegionManager myRegionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
IRegion myRegion = myRegionManager.Regions["theNameOfYourRegion"];
int numberOfViews = myRegion.Views.Count();
for (int i = 0; i < numberOfViews; i++)
{
FrameworkElement aView = myRegion.Views.ElementAt(i) as FrameworkElement;
if (aView != null && i == index)
aView.Visibility = System.Windows.Visibility.Visible;
else
aView.Visibility = System.Windows.Visibility.Collapsed;
}
}
I hope this is of any use.