Exemplo n.º 1
0
        public MenuView(IRegionManager regionManager, IEventAggregator eventAggregator, IModuleManager moduleManager)
        {
            this.eventAggregator = eventAggregator;
            //ChangeModuleToMenuEvent cmtmEvent = this.eventAggregator.GetEvent<ChangeModuleToMenuEvent>();
            ////这里订阅一个改变模块的事件,模块改变时修改menu
            //cmtmEvent.Subscribe(OnChangeModuleEvent);

            NavigateToScreenEvent ntsEvent = GlobalData.EventAggregator.GetEvent <NavigateToScreenEvent>();

            ntsEvent.Subscribe(OnLinkageNavigateEvent);
            HNavigateToScreenEvent hntsEvent = GlobalData.EventAggregator.GetEvent <HNavigateToScreenEvent>();

            hntsEvent.Subscribe(OnLinkageHNavigateEvent);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public HeaderView(IRegionManager regionManager, IEventAggregator eventAggregator, IModuleManager moduleManager)
        {
            HNavigateToScreenEvent ntsEvent = GlobalData.EventAggregator.GetEvent <HNavigateToScreenEvent>();

            ntsEvent.Subscribe(OnLinkageNavigateEvent);
        }