예제 #1
0
        public MainViewModel(Community community, SynchronizationService synhronizationService, CompanySelectionModel companySelection, GameSelectionModel gameSelection)
        {
            _gameSelection = gameSelection;
            _community = community;
            _synhronizationService = synhronizationService;
            _companySelection = companySelection;

            if (synhronizationService.Individual != null)
            {
                _companySelectionVM = new CompanySelectionViewModel(
                    synhronizationService.Individual,
                    _companySelection);
            }
        }
예제 #2
0
        public ViewModelLocator()
        {
            _synchronizationService = new SynchronizationService();
            CompanySelectionModel companySelection = new CompanySelectionModel();
            GameSelectionModel gameSelection = new GameSelectionModel(companySelection);
            if (!DesignerProperties.IsInDesignTool)
            {
                _synchronizationService.Initialize();
                companySelection.SelectedCompany = _synchronizationService
                    .Individual.Companies
                    .Ensure()
                    .FirstOrDefault();
            }

            _main = new MainViewModel(
                _synchronizationService.Community,
                _synchronizationService,
                companySelection,
                gameSelection);
        }
 public GameSelectionViewModel(Company company, GameSelectionModel selection)
 {
     _company = company;
     _selection = selection;
 }