示例#1
0
 internal void OnSelectedItemFilm(VMItemFilm selectedItem)
 {
     if (selectedItem != null)
     {
         navigationService.NavigateToSecondPage(selectedItem);
     }
 }
示例#2
0
        public async void LoadCompleteFilm(VMItemFilm chosen)
        {
            Film = new VMCompleteFilm
            {
                Id          = chosen.Id,
                Year        = chosen.Year,
                Description = chosen.Description,
                Title       = chosen.Title,
                Poster      = chosen.Poster
            };

            ManageProgressBar(true);
            var client = new ServiceReferenceFilmInfo.WSFilmInfoPortTypeClient();

            ServiceReferenceFilmInfo.GetMovieDataByIdResponse result =
                await client.GetMovieDataByIdAsync(Film.Id);

            var movie = result.@return;

            Film.Rate       = Convert.ToDouble(movie.Rate);
            Film.Poster     = movie.Poster;
            Film.Background = movie.Background;
            Film.Director   = movie.Director;
            Film.Status     = movie.Status;
            Film.Summary    = movie.Summary;
            Film.Web        = movie.Web;
            Film.Cast       = new ObservableCollection <VMCast>();
            Film.Crew       = new ObservableCollection <VMCrew>();
            Film.Genres     = new ObservableCollection <string>();

            if (movie.Cast != null)
            {
                foreach (var actorInfo in movie.Cast)
                {
                    var cast = new VMCast
                    {
                        Character = actorInfo.Character,
                        Name      = actorInfo.Name,
                        Picture   = actorInfo.Picture
                    };
                    Film.Cast.Add(cast);
                }
            }

            if (movie.Crew != null)
            {
                foreach (var crewInfo in movie.Crew)
                {
                    var crew = new VMCrew()
                    {
                        Department = crewInfo.Department,
                        Job        = crewInfo.Job,
                        Name       = crewInfo.Name,
                        Picture    = crewInfo.Picture
                    };
                    Film.Crew.Add(crew);
                }
            }

            if (movie.Genres != null)
            {
                foreach (var genre in movie.Genres)
                {
                    Film.Genres.Add(genre);
                }
            }
            Film.UpdateObservables();
            ManageProgressBar(false);
        }