Example #1
0
        /// <summary>
        /// Raises the appearing event.
        /// </summary>
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            try {
                // TODO: replace with the real API key
                IMovieSharpClient movieSharpClient = new MovieSharpClient("c2c73ebd1e25cbc29cf61158c04ad78a");

                var response = await movieSharpClient.GetNowPlayingMoviesAsync();

                if (response.IsOk)
                {
                    listView.ItemsSource  = response.Body.Results;
                    listView.ItemTemplate = new DataTemplate(typeof(MovieCell));
                }
            } catch (Exception e) {
                // TODO: handle exception
                Debug.WriteLine(e);
            }
        }