Exemplo n.º 1
0
 private void searchbox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
 {
     //clearMovieGrid();
     if (sender.Text == "")
     {
         replaceMovieGrid(popularMovies);
     }
     else if (sender.Text.Contains("#"))
     {
         if (sender.Text.Contains("watchlist"))
         {
             List <ListMediaReference> watchlist = new List <ListMediaReference>();
             foreach (MovieReference wmr in (App.Current as App).UserDatabase.movies)
             {
                 if (wmr.OnWatchlist)
                 {
                     watchlist.Add(new ListMediaReference(wmr));
                 }
             }
             replaceMovieGrid(watchlist);
         }
     }
     else
     {
         Debug.WriteLine(MediaAccessor.multiSearch(sender.Text).Count);
         replaceMovieGrid(MediaAccessor.multiSearch(sender.Text));
     }
 }
Exemplo n.º 2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            List <ListMediaReference> mp = MediaAccessor.getPopular(1, MediaType.tv);

            foreach (ListMediaReference mm in mp)
            {
                flipGridView.movies.Add(mm);
            }
        }
Exemplo n.º 3
0
        private void MoviePage_Loaded(object sender, RoutedEventArgs e)
        {
            dynamic d = MediaAccessor.getDetails(movieInfo.id, movieInfo.mediaType);

            poster_image.Source = new BitmapImage(new Uri("https://image.tmdb.org/t/p/w1280" + d.poster_path));
            if ((App.Current as App).UserDatabase.movies.Exists(x => (x.id) == movieInfo.id))
            {
                userRating.Score = (App.Current as App).UserDatabase.movies.Find(x => (x.id) == movieInfo.id).review.quality;
            }

            if ((App.Current as App).UserDatabase.movies.Exists(x => x.id == movieInfo.id) && (App.Current as App).UserDatabase.movies.Find(x => x.id == movieInfo.id).OnWatchlist)
            {
                OnWatchlist.IsChecked = true;
            }
            else
            {
                OnWatchlist.IsChecked = false;
            }
        }
Exemplo n.º 4
0
 public MainPage()
 {
     this.InitializeComponent();
     popularMovies.AddRange(MediaAccessor.getPopular(1, MediaType.movie));
     replaceMovieGrid(popularMovies);
 }
Exemplo n.º 5
0
        public ListMediaReference(MediaReference media) : base(media.id, media.original_title, media.mediaType)
        {
            dynamic d = MediaAccessor.getDetails(media.id, media.mediaType);

            init(media.id, media.original_title, media.mediaType, (string)d.poster_path, (string)d.backdrop_path);
        }