Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the WantedMoviesViewModel class.
        /// </summary>
        public SeasonViewModel(IShowService showService)
        {
            // The data service
            _showService = showService;

            // Get all the movies and add them to the Movies collection
            Seasons = new ObservableCollection<Season>();
            _showService.GetSeasons("75760", (result, error) =>
            {
                if (error != null)
                {
                    MessageBox.Show(error.Message);
                    return;
                }

                if (result == null)
                {
                    MessageBox.Show("Nothing found");
                    return;
                }

                foreach (var season in result)
                {
                    Seasons.Add(season);
                }
            });
        }