public void OnLinkageNavigateEvent(CommandRegionEventArgs e) { //ItemsControl ic = new ItemsControl(); //ic.Margin = new Thickness(0); //ic.HorizontalAlignment = HorizontalAlignment.Stretch; //ic.VerticalAlignment = VerticalAlignment.Stretch; //RegionManager.SetRegionName(ic, e.Region); //RegionManager.SetRegionContext(mainContentControl, null); //RegionManager.SetRegionName(mainContentControl, e.Region); //mainContentControl.Content = ic; if (mainRegionCurrentModel != e.Module) { //清理mainRegion //this.regionManager.Regions[e.Region].RemoveAll(); mainRegionCurrentModel = e.Module; //CommandEventArgs ces = new CommandEventArgs(); //ces.Type = CommandType.registerDefViewWithRegion; //ces.ModuleName = e.Module; //GlobalData.EventAggregator.GetEvent<CommandEvent>().Publish(ces); if (!GlobalData.IsLoadModule(e.Module)) { this.moduleManager.LoadModule(e.Module); } } //SystemSetModule_MainView this.regionManager.RequestNavigate(e.Region, e.Module + "_MainView"); //点击导航后加载HeaderView,MenuView this.regionManager.RequestNavigate(RegionNames.Header, "HeaderView"); this.regionManager.RequestNavigate(RegionNames.Aside, "MenuView"); }
private void Button_Click(object sender, RoutedEventArgs e) { CommandRegionEventArgs cms = new CommandRegionEventArgs(); cms.Region = RegionNames.Main; cms.Module = ((sender as Button).Tag as NavModuleInfo).module; cms.menuVm = ((sender as Button).Tag as NavModuleInfo).menuVm; GlobalData.EventAggregator.GetEvent <NavigateToScreenEvent>().Publish(cms); }
private void SystemButton_Click(object sender, RoutedEventArgs e) { UncheckedButtons(); (sender as ToggleButton).IsChecked = true; CommandRegionEventArgs cms = new CommandRegionEventArgs(); cms.Region = RegionNames.Main; cms.Module = ((sender as ToggleButton).Tag as NavModuleInfo).module; cms.menuVm = ((sender as ToggleButton).Tag as NavModuleInfo).menuVm; GlobalData.EventAggregator.GetEvent <HNavigateToScreenEvent>().Publish(cms); }
public void OnLinkageHNavigateEvent(CommandRegionEventArgs e) { if (_contentLoaded) { LayoutRoot.DataContext = e.menuVm; } else { menuVm = e.menuVm; } }
public void OnLinkageNavigateEvent(CommandRegionEventArgs e) { initCheckModule = e.Module; }
public void OnLinkageHNavigateEvent(CommandRegionEventArgs e) { //SystemSetModule_MainView this.regionManager.RequestNavigate(e.Region, e.Module + "_MainView"); }