public SystemSetModule(IModuleTracker moduleTracker, IRegionManager regionManager) { if (moduleTracker == null) { throw new ArgumentNullException("moduleTracker"); } this.moduleTracker = moduleTracker; this.moduleTracker.RecordModuleConstructed(ModuleNames.SystemSet); this.regionManager = regionManager; CommandEvent cmdEvent = GlobalData.EventAggregator.GetEvent <CommandEvent>(); cmdEvent.Subscribe(OnCommandEvent); }
private void Window_Loaded(object sender, RoutedEventArgs e) { SecurityWcf.Core.LoginInfo.UserId = "admin"; SecurityWcf.Core.LoginInfo.Password = "******"; //服务授权码 SecurityWcf.Core.LoginInfo.Token = "ABC"; //注入类 GlobalData.EventAggregator = this.eventAggregator; GlobalData.RegionManager = this.regionManager; GlobalData.ModuleManager = this.moduleManager; GlobalData.ModuleCatalog = this.moduleCatalog; NavigateToScreenEvent ntsEvent = GlobalData.EventAggregator.GetEvent <NavigateToScreenEvent>(); ntsEvent.Subscribe(OnLinkageNavigateEvent); HNavigateToScreenEvent hntsEvent = GlobalData.EventAggregator.GetEvent <HNavigateToScreenEvent>(); hntsEvent.Subscribe(OnLinkageHNavigateEvent); // I subscribe to events to help track module loading/loaded progress. // The ModuleManager uses the Async Events Pattern. //this.moduleManager.LoadModuleCompleted += this.ModuleManager_LoadModuleCompleted; this.moduleManager.ModuleDownloadProgressChanged += this.ModuleManager_ModuleDownloadProgressChanged; mainRegionCurrentModel = ModuleNames.Login; pop.DataContext = bgPop; foreach (var item in bgBtnPanel.Children) { if (item is Button) { Button btn = item as Button; btn.Click += Btn_Click; } } ctrlsProgressRing.IsActive = false; CommandEvent cmdEvent = GlobalData.EventAggregator.GetEvent <CommandEvent>(); cmdEvent.Subscribe(OnCommandEvent); }