title: Unregister a PRISM Region from the RegionManager
body: <p>Is there a way to un-register a region from the RegionManager?</p>
  
  <p>With</p>
  
  <pre><code>RegionManager.SetRegionName(myRegion, regionName);
  RegionManager.SetRegionManager(myRegion, myRegionManager);
  </code></pre>
  
  <p>I do register a region at the RegionManager.</p>
  
  <p>But what, if I need to remove that registration (in order to register the exact same region again)?</p>
  
  <p>===================</p>
  
  <p>This is my situation:</p>
  
  <p>I have an instance <code>myView</code> that registers a UI control (a DependencyObject) <code>myRegion</code> as a region by using:</p>
  
  <pre><code>RegionManager.SetRegionName(myRegion, regionName);
  RegionManager.SetRegionManager(myRegion, myRegionManager);
  </code></pre>
  
  <p>When <code>myView</code> is instantiated, also the local region manager object <code>myRegionManager</code> is instantiated.</p>
  
  <p>Then I need to again create the instance <code>myView</code>, which again makes this registration.</p>
  
  <p>Hence, the new instance <code>myView</code> also instantiates a new local region manager <code>myRegionManager</code>, which of course has no regions associated with.</p>
  
  <p>Then, the call to <code>RegionManager.SetRegionName(...)</code> and <code>RegionManager.SetRegionManager(...)</code> succeedes, but if I then try to access the local region manager <code>myRegionManager</code> by using</p>
  
  <pre><code>IRegion region = myRegionManager.Regions[regionName];
  </code></pre>
  
  <p>I am getting an <code>RegionUpdateException</code>!</p>
  
  <p>If I place</p>
  
  <pre><code>string name = RegionManager.GetRegionName(myRegion);
  
  IRegionManager regionManager = RegionManager.GetRegionManager(myRegion);
  </code></pre>
  
  <p>in front of the registration, both fields are empty by the first instantiation of <code>myView</code>, but they do have values during the second instantiation of <code>myView</code>.</p>
  
  <p>But since both the <code>myRegion</code> and the <code>myRegionManager</code> also get newly instantiated together with <code>myView</code> I expect the name and region manager also to be empty before calling the second registration.</p>