private void ConfigureViewModelMappings()
        {
            _container = Globals.Instance.Container;

            ILogManager                logManager            = _container.Resolve <ILogManager>();
            IMovieService              movieService          = _container.Resolve <IMovieService>();
            ITvShowService             tvShowService         = _container.Resolve <ITvShowService>();
            IPlaybackInfoService       playbackInfoService   = _container.Resolve <IPlaybackInfoService>();
            ILoginService              loginService          = _container.Resolve <ILoginService>();
            ISettingsService           settingsService       = _container.Resolve <ISettingsService>();
            IJellyfinNavigationService navigationService     = _container.Resolve <IJellyfinNavigationService>();
            IReportProgressService     reportProgressService = _container.Resolve <IReportProgressService>();
            IPersonalizeService        personalizeService    = _container.Resolve <IPersonalizeService>();

            _container.RegisterInstance(new MainViewModel(settingsService, navigationService));

            _container.RegisterInstance(new MovieListViewModel(movieService, personalizeService, logManager));
            _container.RegisterInstance(new MovieDetailViewModel(movieService, playbackInfoService, personalizeService, logManager));

            _container.RegisterInstance(new TvShowListViewModel(tvShowService, personalizeService, logManager));
            _container.RegisterInstance(new TvShowDetailViewModel(tvShowService, playbackInfoService, personalizeService, logManager));
            _container.RegisterInstance(new TvShowEpisodeDetailViewModel(tvShowService, playbackInfoService, personalizeService, logManager));

            _container.RegisterInstance(new MediaPlaybackViewModel(reportProgressService, logManager));
            _container.RegisterInstance(new PlaybackConfirmationViewModel(playbackInfoService, personalizeService, logManager));
            _container.RegisterInstance(new LoginViewModel(loginService, settingsService));
        }
        public TvShowListViewModel(ITvShowService tvShowService, IPersonalizeService personalizeService, ILogManager logManager)
            : base(personalizeService, logManager)
        {
            _tvShowService = tvShowService ??
                             throw new ArgumentNullException(nameof(tvShowService));

            ContinueWatchingTvShows = new ObservableCollectionEx <TvShowEpisode>();
        }
        protected NavigableMediaElementViewModelBase(IPersonalizeService personalizeService, ILogManager logManager)
        {
            _personalizeService = personalizeService ??
                                  throw new ArgumentNullException(nameof(personalizeService));

            _logManager = logManager ??
                          throw new ArgumentNullException(nameof(logManager));
        }
        public MovieListViewModel(IMovieService movieService, IPersonalizeService personalizeService, ILogManager logManager)
            : base(personalizeService, logManager)
        {
            _movieService = movieService ??
                            throw new ArgumentNullException(nameof(movieService));

            DisplayedMovies.CollectionChanged += MoviesOnCollectionChanged;
        }
        public MovieDetailViewModel(
            IMovieService movieService, IPlaybackInfoService playbackInfoService,
            IPersonalizeService personalizeService, ILogManager logManager) : base(personalizeService, logManager)
        {
            _movieService = movieService ??
                            throw new ArgumentNullException(nameof(movieService));

            _playbackInfoService = playbackInfoService ??
                                   throw new ArgumentNullException(nameof(playbackInfoService));
        }
Exemple #6
0
        public TvShowEpisodeDetailViewModel(ITvShowService tvShowService, IPlaybackInfoService playbackInfoService, IPersonalizeService personalizeService, ILogManager logManager) : base(personalizeService, logManager)
        {
            _tvShowService = tvShowService ??
                             throw new ArgumentNullException(nameof(tvShowService));

            _playbackInfoService = playbackInfoService ??
                                   throw new ArgumentNullException(nameof(tvShowService));

            PropertyChanged += OnPropertyChanged;
        }
        public PlaybackConfirmationViewModel(IPlaybackInfoService playbackInfoService, IPersonalizeService personalizeService,
                                             ILogManager logManager) : base(personalizeService, logManager)
        {
            _playbackInfoService = playbackInfoService ??
                                   throw new ArgumentNullException(nameof(playbackInfoService));

            _autoPlaybackTimer           = new Timer();
            _autoPlaybackTimer.AutoReset = true;
            _autoPlaybackTimer.Interval  = 1000;
            IsTimerVisible              = true;
            _autoPlaybackTimer.Elapsed += AutoPlaybackTimerOnElapsed;
        }