title: How to load a view in a particular region dynamically in Prism
body: <p>In Prism Silverlight5, I have a shell which is divided into two vertical regions(leftRegion,rightRegion) &amp; there are 2 views in Module1 i.e. (View1,View2).<br/> In leftRegion I have a View1 loaded which has a button.<br/> I want to dynamically load View2 on rightRegion using ViewModel &amp; MEF.ViewModel code is :</p>
  
  <pre><code>    [Export(typeof(LeftViewViewModel))]
  public class LeftViewViewModel:ViewModelBase,IViewModel
  {
      [Import]
      public IRegionManager CullingRegion { get; set; }
  
      [ImportingConstructor]
      public LeftViewViewModel(LeftView view)
          :base(view)
      {
          LoadCommand = new DelegateCommand(LoadControl,CanLoadControl);
      }
  
      private void LoadControl()
      {
          CullingRegion.RegisterViewWithRegion("RightRegion", typeof(RightView));
      }
  
      protected bool CanLoadControl()
      {
          return true;
      }
  
      public DelegateCommand LoadCommand { get; set; }
  }
  </code></pre>
  
  <p>LeftView.xaml.cs is :</p>
  
  <pre><code>    [Import]
      public ViewModels.IViewModel ViewModel
      {
          get { return (IViewModel) DataContext; }
          set { DataContext = value; }
      }
  </code></pre>
  
  <p>IModule implementation is : </p>
  
  <pre><code>[ModuleExport(typeof(CullingModuleModule1))]
  public class CullingModuleModule1:IModule
  {
      [Import]
      public IRegionManager CullingRegion { get; set; }
  
      public void Initialize()
      {
  
          CullingRegion.RegisterViewWithRegion("ShellContentRegion", typeof (Container));
          CullingRegion.RegisterViewWithRegion("LeftRegion", typeof(LeftView));
  
  
      }
  }
  </code></pre>