Exemplo n.º 1
0
        public ImportGameViewModel(IConnectionWebApi api, IDialogCoordinator dialogCoordinator)
        {
            _currentWebApi = api;
            _dialogCoordinator = dialogCoordinator;

            AvailableGenres = new ObservableCollection<Genre>(_currentWebApi.GetGenres());
            AvailableGenres.Add(new Genre { Name = "Tutti", GenreId = "Tutti" });
            AvailablePlatforms = new ObservableCollection<Platform>(_currentWebApi.GetPlatforms());
            AvailablePlatforms.Add(new Platform() { Name = "Tutti", PlatformId = "Tutti"});
            BindingOperations.EnableCollectionSynchronization(GamesDto, _lock);
            _mapper = new MapperConfiguration(MapperGameImport).CreateMapper();
            BindingOperations.EnableCollectionSynchronization(GamesDto, _lock);
            DataInizio = DateTime.Now.AddMonths(-3);
            DataFine = DateTime.Now;
            IsReadOnlyTitleSearch = true;
        }
Exemplo n.º 2
0
 public ListGameViewModel(IConnectionWebApi webApi, IDialogCoordinator dialogCoordinator)
 {
     _currentWebApi = webApi;
     _dialogCoordinator = dialogCoordinator;
     AvailableGenres = new ObservableCollection<Genre>(_currentWebApi.GetGenres());
     AvailableGenres.Add(default(Genre));
     AvailablePlatforms = new ObservableCollection<Platform>(_currentWebApi.GetPlatforms());
     AvailablePlatforms.Add(default(Platform));
     BindingOperations.EnableCollectionSynchronization(GamesDto, _lock);
     _mapper = new MapperConfiguration(MapperGameImport).CreateMapper();
 }