private void SwitchView(UserControl view) { try { dispatcher.BeginInvoke(() => { contentRegion = this.regionManager.Regions[RegionContainer.Content]; AccessControlView vw = container.Resolve <AccessControlView>(); string v = vw.ToString(); if (currentView != null) { if (currentView.ToString() == view.ToString()) { return; } } if (view.ToString() == "Mango.Staff.Views.AccessControlView") { if (contentRegion.GetView(view.ToString()) == null) { contentRegion.Add(view, null, true); //create a scoped region } } else { contentRegion.Add(view); } currentView = view; contentRegion.Activate(view); Animation.SwitchToPage(); }); } catch (Exception ex) { Utility.DisplayMessage(ex.Message); } }
private void OnAccessControlCommand() { AccessControlView view = container.Resolve <AccessControlView>(); SwitchView(view); }