Removing view that contain regions

Topics: Prism v4 - WPF 4
Jun 23, 2011 at 8:46 AM
Edited Jun 23, 2011 at 8:48 AM


I'm using prism 4 to implement MVVM in my application.
My application contains view that has several regions within,when I'm removing this view from its container region it's seems like the regions in the view are still exist in memory.

I would like to know if removing view doesn't effect its inner regions and what is the best way to handel the case of hierarchy removing (I tried to do it with recursion but it takes a lot of time)



Jun 23, 2011 at 4:03 PM

Hi Eran,

This is an existing issue on Prism v2 and v4, you could take a look at the Damian Schenkelman’s Blog post, which proposes a workaround for this behavior:

Memory Leak removing View with child regions in Prism-v2

I hope you find this information useful.


Miguel Bronzovic

Jun 26, 2011 at 7:23 AM

Hi Miguel,

Thanks a lot for your reply it sure did helped me to understand the problem better ,but unfortunately it didn't improve the performence.

I think I will open new discussion about adding/removing a lot of views to a region vs. using classic items source binding.
Thanks any way