Esempio n. 1
0
        private async Task LoadMoviesAsync()
        {
            var data = await MovieListRepository.BoxOfficeMovies();

            /*
             * C_Source.Movies = new List<MovieEntry>(data.In_Theatres);
             *
             * foreach (MovieEntry me in data.Opening_Movies) {
             *      C_Source.Movies.Add (me);
             * }
             * foreach (MovieEntry me in data.Top_BoxOffice) {
             *      C_Source.Movies.Add (me);
             * }
             */
            C_Source.Movies             = new List <MovieEntry>(data.In_Theatres);
            C_Source.Custom_Table_Items = new List <TableGroupItems> ();

            TableGroupItems CGroup = new TableGroupItems("In Theatres");

            C_Source.Custom_Table_Items.Add(CGroup);

            foreach (MovieEntry me in data.In_Theatres)
            {
                CGroup.Items.Add(me);
            }
            CGroup = new TableGroupItems("Opening In Theatres");
            C_Source.Custom_Table_Items.Add(CGroup);

            foreach (MovieEntry me in data.Opening_Movies)
            {
                CGroup.Items.Add(me);
            }

            CGroup = new TableGroupItems("Top Box Office");
            C_Source.Custom_Table_Items.Add(CGroup);

            foreach (MovieEntry me in data.Top_BoxOffice)
            {
                CGroup.Items.Add(me);
            }
            TableView.ReloadData();
        }
		private async Task LoadMoviesAsync()
		{
			var data = await MovieListRepository.BoxOfficeMovies();

			/*
	C_Source.Movies = new List<MovieEntry>(data.In_Theatres);

			foreach (MovieEntry me in data.Opening_Movies) {
				C_Source.Movies.Add (me);
			}
			foreach (MovieEntry me in data.Top_BoxOffice) {
				C_Source.Movies.Add (me);
			}
			*/
			C_Source.Movies = new List<MovieEntry>(data.In_Theatres);
			C_Source.Custom_Table_Items = new List<TableGroupItems> ();

			TableGroupItems CGroup = new TableGroupItems ("In Theatres");
			C_Source.Custom_Table_Items.Add (CGroup);

			foreach (MovieEntry me in data.In_Theatres) {
				CGroup.Items.Add (me);
			}
			CGroup = new TableGroupItems ("Opening In Theatres");
			C_Source.Custom_Table_Items.Add (CGroup);

			foreach (MovieEntry me in data.Opening_Movies) {
				CGroup.Items.Add (me);
			}

			CGroup = new TableGroupItems ("Top Box Office");
			C_Source.Custom_Table_Items.Add (CGroup);

			foreach (MovieEntry me in data.Top_BoxOffice) {
				CGroup.Items.Add (me);
			}
			TableView.ReloadData();
		}