private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { SelectedSWMovie = e.AddedItems[0] as SWMovie; if (e != null) { this.DataContext = SelectedSWMovie; } }
private void downButton_Click_1(object sender, RoutedEventArgs e) { SWMovie sw = (SWMovie)DataContext; if (sw.Rating > 0) { sw.Rating -= 1; } }
private void upButton_Click(object sender, RoutedEventArgs e) { SWMovie sw = (SWMovie)DataContext; if (sw.Rating < 10) { sw.Rating += 1; } }
public List <SWPlanet> GetAllSWPlanets(SWMovie movie) { List <SWPlanet> planets = new List <SWPlanet>(); foreach (string url in movie.PlanetUris) { planets.Add(GetPlanetByUrl(url)); } return(planets); }
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; }
private void OnSelectedMovieRecieved(SWMovie movie) { SelectedSWMovie = movie; //SWPlanets = new ObservableCollection<SWPlanet>(planetService.AllPlanets(movie)); }
public List <SWPlanet> GetAllSWPlanets(SWMovie movie) { throw new NotImplementedException(); }
public List <SWPlanet> AllPlanets(SWMovie movie) { return(repository.GetAllSWPlanets(movie)); }