Exemplo n.º 1
0
        public virtual IModuleResources GetModuleResources()
        {
            if (_resources == null)
            {
                _resources = CreateModuleResources();
            }

            return(_resources);
        }
Exemplo n.º 2
0
        public ModuleBaseInit(IRegionManager regionManager, IEventAggregator eventAggregator, IServiceLocator serviceLocator, ILighterClientContext lighterContext)
        {
            _regionManager   = regionManager;
            _serviceLocator  = serviceLocator;
            _eventAggregator = eventAggregator;
            _lighterContext  = lighterContext;

            _resources = null;
        }
Exemplo n.º 3
0
        protected virtual void MenuItemAndToolbarInitialize(Type type, string topMenuHeader, string topMenuName)
        {
            IModuleResources resources = GetModuleResources();
            ObservableCollection <CommandInfo> commandInfos = resources.GetCommandInfos(type);

            foreach (CommandInfo info in commandInfos)
            {
                CommandBinding cmdBinding = CreateCommandBindingFroUICommand(info.Command);
                if (cmdBinding != null)
                {
                    info.CommandBinding = cmdBinding;
                }
            }

            AddCommandInfosIntoGlobalCommands(commandInfos);

            _eventAggregator.GetEvent <ToolbarButtonAddedEvent>().Publish(commandInfos);

            ObservableCollection <MenuItem> menuItems = GetMenuItemsWithTopMenuItem(commandInfos, topMenuHeader, topMenuName);

            _eventAggregator.GetEvent <MenuItemAddedEvent>().Publish(menuItems);
        }