public ItemSearchViewModel(
            List<GameItemModel> items,
            IApiDataUpdater apiDataUpdater,
            WatchlistViewModel watchlistViewModel
            )
        {
            ViewModelName = "Search";
            _apiDataUpdater = apiDataUpdater;
            _watchlistViewModel = watchlistViewModel;
            _items = new List<GameItemModel>(items);

            Items = new PaginatedObservableCollection<GameItemModel>(_items, 20);

            _subTypeDictionary = BuildSubtypeDictionary(_items);
            SelectedRarity = RarityModel.Rarities.First();
        }
Exemple #2
0
        public MainViewModel()
        {
            Init();

            var watchlistViewModel = new WatchlistViewModel(_contextProvider, _sharedItems);
            var searchViewModel = new ItemSearchViewModel(_sharedItems, _dataUpdater, watchlistViewModel);
            var investmentViewModel = new InvestmentViewModel(_contextProvider, _sharedItems, _sharedItemDictionary);
            var settingsViewModel = new SettingsViewModel(_dbBuilder);

            ChildViews = new ObservableCollection<BaseViewModel>
            {
                searchViewModel,
                watchlistViewModel,
                investmentViewModel,
                settingsViewModel
            };
        }