Remove view does not remove all sub-views

Dec 11, 2009 at 2:40 PM

I have a view - let's call it parent view - that has two regions (left, right) and in each region I inject views. When I remove the parent view from it's region, the left, right regions are still registered with the RegionManager and their views are not removed.
Is this a default behavior? Should I remove manually all the sub-views and the regions?


Dec 11, 2009 at 10:26 PM

Hi Jimmi,

This is not the expected behavior. However, I have tried to reproduce your issue with no success. I have uploaded the code I used here. Check it out and let me know what are the differences with your scenario so I can try to reproduce it.

To use the sample:

  1. Click the “Check Region Manager” button. It should work OK.
  2. Click the “Remove View From Region” button. It should remove the HelloWorldView which holds another region (“MyNewRegion”).
  3. Click the “Check Region Manager” button again. It should throw an exception as the region “MyNewRegion” does no exist.

Please let me know if this helps.

Damian Schenkelman


Dec 15, 2009 at 2:41 PM

Hi Damian,

Thanks for your reply. My scenario has another level of views - I have uploaded the sample here - which is a silverlight project - with the exact behavior. In the right region I have 2 sub-views which are not removed when I remove the parent region.
If you have the time please take a look at this simple sample.


Dec 23, 2009 at 8:24 PM

Hi Jimmi,

We have been working on this issue and have found a fix for it. You can read more about this here.

Please let me know if this helps.

Damian Schenkelman

Dec 28, 2009 at 2:50 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.