private void DisplayMovie()
        {
            try
            {
                if (MovieList != null)
                {
                    MovieList.Clear();
                }

                var selectedGenres = GenersList.FirstOrDefault(a => a.GenerName == continent);
                if (selectedGenres.GenerId == 0)
                {
                    MovieList = MainMovieList;
                    return;
                }
                //var List = MainMovieList;
                var ListSelected = MainMovieList.Where(movie => movie.GenreIds.Contains(selectedGenres.GenerId));

                MovieList = new ObservableCollection <MovieDetails>(ListSelected);
            }
            catch (Exception ex)
            {
                //UserDialogs.Instance.Alert(ex.Message, "Apologies", "Ok");
            }
        }
Esempio n. 2
0
        public DashBoardViewModel(string continent)
        {
            try
            {
                MovieList.Clear();

                var selectedGenres = GenersList.FirstOrDefault(a => a.GenerName == continent);
                if (selectedGenres.GenerId == 0)
                {
                    MovieList = MainMovieList;
                    return;
                }
                //var List = MainMovieList;
                var ListSelected = MainMovieList.Where(movie => movie.GenreIds.Contains(selectedGenres.GenerId));

                MovieList = new ObservableCollection <MovieDetails>(ListSelected);
            }
            catch (Exception ex)
            {
                UserDialogs.Instance.Alert(ex.Message, "Apologies", "Ok");
            }
        }