コード例 #1
0
        public SkinDesignerViewModel(IServiceLocator serviceLocator,
                                     AvailableGameViewModelCollection existingClientGames,
                                     AvailableGameViewModelCollection allOtherGames,
                                     FilterableCollectionViewModel <ArenaFilterViewModel> availableFilters,
                                     SkinDefinitionViewModel skinDefinition,
                                     ExplorerBarViewModel explorerBar,
                                     IEnumerable <ErrorMessageViewModel> buildErrors,
                                     SkinIndentity sourceSkin,
                                     SkinIndentity destinationSkin)
        {
            serviceLocator.GetInstance <IUnityContainer>().RegisterInstance <ISkinDesigner>(this);

            ServiceLocator   = serviceLocator;
            AvailableGames   = existingClientGames;
            NewGames         = allOtherGames;
            AvailableFilters = availableFilters;
            SkinDefinition   = skinDefinition;
            ExplorerBar      = explorerBar;
            _buildErrors     = buildErrors;
            SourceSkin       = sourceSkin;
            DestinationSkin  = destinationSkin;

            CreateCommands();

            InitMockupViewModel();

            RegisterGlobalNotificationHandlers();


            _validator = new SkinValidator(this,
                                           ServiceLocator.GetInstance <IApplicationServices>());

            RegisterApplicationExitHandler();
        }
コード例 #2
0
 private void LoadExplorerBarItems()
 {
     _explorerBar = new ExplorerBarViewModel(_serviceLocator);
     _explorerBar.Items.Add(new ArenaCollectionExplorerBarItem(_skinDefinition.Arenas, _serviceLocator)
     {
         IsExpanded = true
     });
     _explorerBar.Items.Add(new LobbyCollectionExplorerBarItem(_skinDefinition.Lobbies, _serviceLocator));
     _explorerBar.Items.Add(new GameGroupLayoutCollectionExplorerBarItem(_skinDefinition.TopGames, _serviceLocator));
     _explorerBar.Items.Add(new GameGroupLayoutCollectionExplorerBarItem(_skinDefinition.VipGames, _serviceLocator));
     _explorerBar.Items.Add(new MyAccountExplorerBarItem(_skinDefinition.MyAccount, _serviceLocator));
     _explorerBar.Items.Add(new TriggersExplorerBarItem(_skinDefinition.Triggers, _serviceLocator));
 }