コード例 #1
0
 private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     SelectedSWMovie = e.AddedItems[0] as SWMovie;
     if (e != null)
     {
         this.DataContext = SelectedSWMovie;
     }
 }
コード例 #2
0
        private void downButton_Click_1(object sender, RoutedEventArgs e)
        {
            SWMovie sw = (SWMovie)DataContext;

            if (sw.Rating > 0)
            {
                sw.Rating -= 1;
            }
        }
コード例 #3
0
        private void upButton_Click(object sender, RoutedEventArgs e)
        {
            SWMovie sw = (SWMovie)DataContext;

            if (sw.Rating < 10)
            {
                sw.Rating += 1;
            }
        }
コード例 #4
0
        public List <SWPlanet> GetAllSWPlanets(SWMovie movie)
        {
            List <SWPlanet> planets = new List <SWPlanet>();

            foreach (string url in movie.PlanetUris)
            {
                planets.Add(GetPlanetByUrl(url));
            }
            return(planets);
        }
コード例 #5
0
        public MainPage()
        {
            this.InitializeComponent();
            movieService = new MovieService(new SWAPIRepository());
            var movies = movieService.AllMovies();

            SWMovies               = new ObservableCollection <SWMovie>(movies);
            selectedSWMovie        = swMovies.First();
            this.DataContext       = SelectedSWMovie;
            moviesList.ItemsSource = SWMovies;
        }
コード例 #6
0
 private void OnSelectedMovieRecieved(SWMovie movie)
 {
     SelectedSWMovie = movie;
     //SWPlanets = new ObservableCollection<SWPlanet>(planetService.AllPlanets(movie));
 }
コード例 #7
0
 public List <SWPlanet> GetAllSWPlanets(SWMovie movie)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public List <SWPlanet> AllPlanets(SWMovie movie)
 {
     return(repository.GetAllSWPlanets(movie));
 }