public void NavigateView(ViewMenuItemBase vmi, object parameter) { if (vmi == null) { return; } if (!string.IsNullOrEmpty(vmi.ViewName) && parameter != null) { if (this.NavigationParamsDictionary.ContainsKey(vmi.ViewName)) { this.NavigationParamsDictionary[vmi.ViewName] = parameter; } else { this.NavigationParamsDictionary.Add(vmi.ViewName, parameter); } } this.NavigateView(vmi); if (vmi is ModalViewMenuItem) { vmi.Navigate <object>(parameter); } }
public static ImageAwesome GetDefaultIconByVmiType(ViewMenuItemBase item) { var icon = new ImageAwesome(); SetDefaultIconProperties(icon); return(icon); }
public void NavigateView(ViewMenuItemBase vmi) { try { if (vmi is ViewMenuItem) { if (this.NavigationMode == NavigationWrapperType.Docking) { //this.regionManager.Regions.Remove(RegionNames.MainViewContentRegion); this.regionManager.RequestNavigate(RegionNames.MainViewContentRegion, typeof(Views.NavigationManagerView).FullName); this.NavigationMode = NavigationWrapperType.Page; this.regionManager.Regions[RegionNames.MainDockingRegion].NavigationService.NavigationFailed -= NavigationService_NavigationFailed; } this.regionManager.RequestNavigate(RegionNames.NavigationContentRegion, vmi.ViewName); } else if (vmi is DockableViewMenuItem) { if (this.NavigationMode == NavigationWrapperType.Page) { this.regionManager.Regions[RegionNames.MainViewContentRegion].NavigationService.NavigationFailed += NavigationService_NavigationFailed1; //this.regionManager.Regions.Remove(RegionNames.MainViewContentRegion); this.regionManager.RequestNavigate(RegionNames.MainViewContentRegion, typeof(Views.MainDockingView).FullName); this.regionManager.Regions[RegionNames.MainViewContentRegion].NavigationService.NavigationFailed -= NavigationService_NavigationFailed1; this.NavigationMode = NavigationWrapperType.Docking; this.regionManager.Regions[RegionNames.MainDockingRegion].NavigationService.NavigationFailed += NavigationService_NavigationFailed; } this.NavigateToWindowDockPanel(vmi as DockableViewMenuItem); } } catch (Exception ex) { System.Windows.MessageBox.Show(ex.Message, "NavigateView"); } }