/// <summary> /// Initializes a new instance of the MoviePlayerViewModel class. /// </summary> /// <param name="applicationState">Main view model</param> /// <param name="movieService">Movie service</param> /// <param name="movieHistoryService">Movie history service</param> public MoviePlayerViewModel(IApplicationState applicationState, IMovieService movieService, IMovieHistoryService movieHistoryService) : base(applicationState, movieService, movieHistoryService) { RegisterMessages(); RegisterCommands(); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> /// <param name="movieService">Instance of MovieService</param> /// <param name="movieHistoryService">Instance of MovieHistoryService</param> /// <param name="applicationService">Instance of ApplicationService</param> public MoviePageViewModel(IMovieService movieService, IMovieHistoryService movieHistoryService, IApplicationService applicationService) { _movieService = movieService; _movieHistoryService = movieHistoryService; ApplicationService = applicationService; GenresMovie = new GenresMovieViewModel(_movieService); RegisterMessages(); RegisterCommands(); Search = new SearchMovieViewModel(); DispatcherHelper.CheckBeginInvokeOnUI(async() => { Tabs.Add(new PopularMovieTabViewModel(ApplicationService, _movieService, _movieHistoryService)); Tabs.Add(new GreatestMovieTabViewModel(ApplicationService, _movieService, _movieHistoryService)); Tabs.Add(new RecentMovieTabViewModel(ApplicationService, _movieService, _movieHistoryService)); Tabs.Add(new FavoritesMovieTabViewModel(ApplicationService, _movieService, _movieHistoryService)); Tabs.Add(new SeenMovieTabViewModel(ApplicationService, _movieService, _movieHistoryService)); SelectedTab = Tabs.First(); SelectedMoviesIndexMenuTab = 0; var loadMoviesTask = Tabs.ParallelForEachAsync(async tab => { await tab.LoadMoviesAsync(); }); var loadGenreTask = GenresMovie.LoadGenresAsync(); await Task.WhenAll(new List <Task> { loadMoviesTask, loadGenreTask }); }); }
/// <summary> /// Initializes a new instance of the TrailerViewModel class. /// </summary> /// <param name="movieService">Movie service</param> /// <param name="applicationState">Application state</param> /// <param name="movieHistoryService">Movie history service</param> public TrailerViewModel(IMovieService movieService, IApplicationState applicationState, IMovieHistoryService movieHistoryService) { _movieService = movieService; _applicationState = applicationState; _movieHistoryService = movieHistoryService; }
/// <summary> /// Initializes a new instance of the SearchTabViewModel class. /// </summary> /// <param name="applicationState">Application state</param> /// <param name="movieService">Movie service</param> /// <param name="movieHistoryService">Movie history service</param> public SearchTabViewModel(IApplicationState applicationState, IMovieService movieService, IMovieHistoryService movieHistoryService) : base(applicationState, movieService, movieHistoryService) { RegisterMessages(); RegisterCommands(); TabName = LocalizationProviderHelper.GetLocalizedValue<string>("SearchTitleTab"); }
/// <summary> /// Initializes a new instance of the GreatestMovieTabViewModel class. /// </summary> /// <param name="applicationService">Application state</param> /// <param name="movieService">Movie service</param> /// <param name="movieHistoryService">Movie history service</param> public GreatestMovieTabViewModel(IApplicationService applicationService, IMovieService movieService, IMovieHistoryService movieHistoryService) : base(applicationService, movieService, movieHistoryService) { RegisterMessages(); RegisterCommands(); TabName = LocalizationProviderHelper.GetLocalizedValue <string>("GreatestMovieTitleTab"); }
/// <summary> /// Initializes a new instance of the PopularMovieTabViewModel class. /// </summary> /// <param name="applicationService">Application state</param> /// <param name="movieService">Movie service</param> /// <param name="movieHistoryService">Movie history service</param> public PopularMovieTabViewModel(IApplicationService applicationService, IMovieService movieService, IMovieHistoryService movieHistoryService) : base(applicationService, movieService, movieHistoryService) { RegisterMessages(); RegisterCommands(); TabName = LocalizationProviderHelper.GetLocalizedValue <string>("PopularMovieTitleTab"); Movies = new ObservableCollection <MovieJson>(); }
/// <summary> /// Initializes a new instance of the WindowViewModel class. /// </summary> /// <param name="applicationService">Instance of Application state</param> /// <param name="movieHistoryService">Instance of movie history service</param> public WindowViewModel(IApplicationService applicationService, IMovieHistoryService movieHistoryService) { _movieHistoryService = movieHistoryService; _dialogCoordinator = DialogCoordinator.Instance; _applicationService = applicationService; RegisterMessages(); RegisterCommands(); AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; PageUri = "/Pages/HomePage.xaml"; }
/// <summary> /// Initializes a new instance of the TabsViewModel class. /// </summary> protected TabsViewModel(IApplicationState applicationState, IMovieService movieService, IMovieHistoryService movieHistoryService) { ApplicationState = applicationState; MovieService = movieService; MovieHistoryService = movieHistoryService; RegisterMessages(); RegisterCommands(); MaxMoviesPerPage = Constants.MaxMoviesPerPage; CancellationLoadingMovies = new CancellationTokenSource(); }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> /// <param name="genresViewModel">Instance of GenresViewModel</param> /// <param name="movieService">Instance of MovieService</param> /// <param name="movieHistoryService">Instance of MovieHistoryService</param> /// <param name="applicationState">Instance of ApplicationState</param> public MainViewModel(IGenresViewModel genresViewModel, IMovieService movieService, IMovieHistoryService movieHistoryService, IApplicationState applicationState) { _dialogCoordinator = DialogCoordinator.Instance; _movieService = movieService; _movieHistoryService = movieHistoryService; ApplicationState = applicationState; GenresViewModel = genresViewModel; RegisterMessages(); RegisterCommands(); AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> /// <param name="genresViewModel">Instance of GenresViewModel</param> /// <param name="movieService">Instance of MovieService</param> /// <param name="movieHistoryService">Instance of MovieHistoryService</param> /// <param name="applicationState">Instance of ApplicationState</param> public MainViewModel(IGenresViewModel genresViewModel, IMovieService movieService, IMovieHistoryService movieHistoryService, IApplicationState applicationState) { _dialogCoordinator = DialogCoordinator.Instance; _movieService = movieService; _movieHistoryService = movieHistoryService; ApplicationState = applicationState; GenresViewModel = genresViewModel; RegisterMessages(); RegisterCommands(); AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; AppDomain.CurrentDomain.ProcessExit += (sender, args) => _updateManager.Dispose(); _updateManager = new UpdateManager(Constants.UpdateServerUrl, Constants.ApplicationName); }
/// <summary> /// Initializes a new instance of the MediaPlayerViewModel class. /// </summary> protected MediaPlayerViewModel(IApplicationState applicationState, IMovieService movieService, IMovieHistoryService movieHistoryService) : base(applicationState, movieService, movieHistoryService) { }
/// <summary> /// Initializes a new instance of the TrailerPlayerViewModel class. /// </summary> /// <param name="applicationState">Main view model</param> /// <param name="movieService">Movie service</param> /// <param name="movieHistoryService">Movie history service</param> public TrailerPlayerViewModel(IApplicationState applicationState, IMovieService movieService, IMovieHistoryService movieHistoryService) : base(applicationState, movieService, movieHistoryService) { RegisterCommands(); }