public LivestreamListViewModel(
            IMonitorStreamsModel monitorStreamsModel,
            FilterModel filterModel,
            StreamLauncher streamLauncher,
            INavigationService navigationService)
        {
            if (monitorStreamsModel == null)
            {
                throw new ArgumentNullException(nameof(monitorStreamsModel));
            }
            if (streamLauncher == null)
            {
                throw new ArgumentNullException(nameof(streamLauncher));
            }
            if (navigationService == null)
            {
                throw new ArgumentNullException(nameof(navigationService));
            }

            this.streamLauncher    = streamLauncher;
            this.navigationService = navigationService;
            this.StreamsModel      = monitorStreamsModel;
            FilterModel            = filterModel;
            refreshTimer           = new DispatcherTimer {
                Interval = Constants.RefreshPollingTime
            };
        }
Esempio n. 2
0
        public HeaderViewModel(
            IMonitorStreamsModel monitorStreamsModel,
            StreamLauncher streamLauncher,
            FilterModel filterModelModel,
            IApiClientFactory apiClientFactory,
            ApiClientsQualitiesViewModel apiClientsQualitiesViewModel,
            IWindowManager windowManager)
        {
            if (monitorStreamsModel == null)
            {
                throw new ArgumentNullException(nameof(monitorStreamsModel));
            }
            if (streamLauncher == null)
            {
                throw new ArgumentNullException(nameof(streamLauncher));
            }
            if (filterModelModel == null)
            {
                throw new ArgumentNullException(nameof(filterModelModel));
            }
            if (apiClientFactory == null)
            {
                throw new ArgumentNullException(nameof(apiClientFactory));
            }

            FilterModel                       = filterModelModel;
            MonitorStreamsModel               = monitorStreamsModel;
            this.streamLauncher               = streamLauncher;
            this.apiClientFactory             = apiClientFactory;
            this.windowManager                = windowManager;
            this.apiClientsQualitiesViewModel = apiClientsQualitiesViewModel ?? throw new ArgumentNullException(nameof(apiClientsQualitiesViewModel));
        }
        public HeaderViewModel(
            IMonitorStreamsModel monitorStreamsModel,
            StreamLauncher streamLauncher,
            FilterModel filterModelModel,
            IApiClientFactory apiClientFactory)
        {
            if (monitorStreamsModel == null)
            {
                throw new ArgumentNullException(nameof(monitorStreamsModel));
            }
            if (streamLauncher == null)
            {
                throw new ArgumentNullException(nameof(streamLauncher));
            }
            if (filterModelModel == null)
            {
                throw new ArgumentNullException(nameof(filterModelModel));
            }
            if (apiClientFactory == null)
            {
                throw new ArgumentNullException(nameof(apiClientFactory));
            }

            FilterModel           = filterModelModel;
            MonitorStreamsModel   = monitorStreamsModel;
            this.streamLauncher   = streamLauncher;
            this.apiClientFactory = apiClientFactory;
        }
        public VodListViewModel(
            StreamLauncher streamLauncher,
            IMonitorStreamsModel monitorStreamsModel,
            IApiClientFactory apiClientFactory)
        {
            this.streamLauncher = streamLauncher ?? throw new ArgumentNullException(nameof(streamLauncher));
            this.monitorStreamsModel = monitorStreamsModel ?? throw new ArgumentNullException(nameof(monitorStreamsModel));
            this.apiClientFactory = apiClientFactory ?? throw new ArgumentNullException(nameof(apiClientFactory));

            ItemsPerPage = VOD_TILES_PER_PAGE;
        }
Esempio n. 5
0
        public TopStreamsViewModel(
            IMonitorStreamsModel monitorStreamsModel,
            ISettingsHandler settingsHandler,
            StreamLauncher streamLauncher,
            INavigationService navigationService,
            IApiClientFactory apiClientFactory)
        {
            if (monitorStreamsModel == null)
            {
                throw new ArgumentNullException(nameof(monitorStreamsModel));
            }
            if (settingsHandler == null)
            {
                throw new ArgumentNullException(nameof(settingsHandler));
            }
            if (streamLauncher == null)
            {
                throw new ArgumentNullException(nameof(streamLauncher));
            }
            if (navigationService == null)
            {
                throw new ArgumentNullException(nameof(navigationService));
            }
            if (apiClientFactory == null)
            {
                throw new ArgumentNullException(nameof(apiClientFactory));
            }

            this.monitorStreamsModel = monitorStreamsModel;
            this.settingsHandler     = settingsHandler;
            this.streamLauncher      = streamLauncher;
            this.navigationService   = navigationService;
            this.apiClientFactory    = apiClientFactory;

            ItemsPerPage = STREAM_TILES_PER_PAGE;
            StreamQualities.AddRange(Enum.GetNames(typeof(StreamQuality)));

            PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == nameof(Page))
                {
                    NotifyOfPropertyChange(() => CanPrevious);
                }
            };
        }