예제 #1
0
 /// <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
                });
            });
        }
예제 #3
0
 /// <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;
 }
예제 #4
0
 /// <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");
 }
예제 #5
0
 /// <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;
 }
예제 #6
0
 /// <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");
 }
예제 #7
0
 /// <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>();
 }
예제 #8
0
 /// <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";
 }
예제 #9
0
        /// <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();
        }
예제 #10
0
        /// <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();
        }
예제 #11
0
 /// <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;
 }
예제 #12
0
 /// <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);
 }
예제 #13
0
 /// <summary>
 /// Initializes a new instance of the MediaPlayerViewModel class.
 /// </summary>
 protected MediaPlayerViewModel(IApplicationState applicationState, IMovieService movieService,
                                IMovieHistoryService movieHistoryService)
     : base(applicationState, movieService, movieHistoryService)
 {
 }
예제 #14
0
 /// <summary>
 /// Initializes a new instance of the MediaPlayerViewModel class.
 /// </summary>
 protected MediaPlayerViewModel(IApplicationState applicationState, IMovieService movieService,
     IMovieHistoryService movieHistoryService)
     : base(applicationState, movieService, movieHistoryService)
 {
 }
예제 #15
0
 /// <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();
 }
예제 #16
0
 /// <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);
 }
예제 #17
0
 /// <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;
 }
예제 #18
0
 /// <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 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();
 }