My requirement is I have a region and I wll be switching betweeen the views based on button click.
I have a NavigateCommand which is binded to two buttons and my execute function of the command looks like hte below snippet.
void Navigate(object result)
if (result != null)
if (result.ToString() == "UserControlA")
_regionManager.RequestNavigate("myregion", new Uri("UserControlA", UriKind.Relative));
_regionManager.RequestNavigate("myregion", new Uri("UserControlB", UriKind.Relative) });
I was happily switching between the views on a region until I started learning about Loading modules on Demand.
I went through a link "https://www.codeproject.com/Articles/41931/Composite-WPF-Display-on-Demand
In this link the Activate and DeActivate methods were used to add/remove views to/from hte region, like .
// Activate Module A view
var moduleAView = mainRegion.GetView("ModuleA.ModuleAView");
// Remove existing views
foreach (var oldViewName in region.Views)
var oldView = region.GetView(oldViewName);
what is the difference between this technique and the one that I mentioned above or am I mission something here. kindly explain.