Clearing the Views from the Particular view

Topics: Prism v4 - WPF 4
Nov 18, 2011 at 12:16 PM

Hi All,

I want to clear the Views from particular region. I have used the following code but i couldn't solution on views clearing.


   foreach ( var view in regionManager.Regions[RegionNames.MainViewRegion].Views)
                while (view != null)


Please find the solution for removing the views from the particular region.


Thanks and regards,


Nov 18, 2011 at 4:30 PM


You could try something like this:

var regionManager = ServiceLocator.Current.GetInstance<IRegionManager(); 
var myRegion = regionManager.Regions["MainRegion"];

            while (myRegion.Views.Count() > 0)

I hope you find this helpful.

Guido Leandro Maliandi