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));
        }
        protected JellyfinViewModelBase()
        {
            IUnityContainer container = Globals.Instance.Container;

            NavigationService = container.Resolve <IJellyfinNavigationService>();

            ToolCommand = new RelayCommand <string>(Execute, CanExecute);
        }
Beispiel #3
0
        public MainViewModel(ISettingsService settingsService, IJellyfinNavigationService jellyfinNavigationService)
        {
            _settingsService = settingsService ??
                               throw new ArgumentNullException(nameof(settingsService));

            _navigationService = jellyfinNavigationService ??
                                 throw new ArgumentNullException(nameof(jellyfinNavigationService));

            IsShowMovies = true;
        }