public FilmPage(String url, List <String> backUrl) { InitializeComponent(); filmUrl = url; this.backUrl = backUrl; backButton.Click += GoBack; if (this.backUrl.Last() == "") { backButton.Visibility = Visibility.Hidden; } else { backButton.Visibility = Visibility.Visible; } film = FilmViewModel.GetFilm(url); title.Content += film.title; open.Content += film.opening_crawl + V; director.Content += ' ' + film.director; producer.Content += ' ' + film.producer; release.Content += ' ' + ConvertToDateTime(film.release_date); created.Content += ' ' + ConvertToDateTime(film.created); edited.Content += ' ' + ConvertToDateTime(film.edited); ListCharacters.MouseDoubleClick += CallPeople; ListSpaceShip.MouseDoubleClick += callStarship; ListVehicles.MouseDoubleClick += CallVehicule; ListSpecies.MouseDoubleClick += CallSpecies; ListCharacters.Items.Clear(); ListSpaceShip.Items.Clear(); ListSpecies.Items.Clear(); ListVehicles.Items.Clear(); foreach (String charac in film.characters) { ListCharacters.Items.Add(PeopleViewModel.GetPeople(charac)); } foreach (String v in film.vehicles) { ListVehicles.Items.Add(VehicleViewModel.GetVehicle(v)); } foreach (String s in film.starships) { ListSpaceShip.Items.Add(StarshipViewModel.GetStarship(s)); } foreach (String spe in film.species) { ListSpecies.Items.Add(SpeciesViewModel.GetSpecies(spe)); } }
public PeoplePage(String url, List <String> backUrl) { InitializeComponent(); people = PeopleViewModel.GetPeople(url); name.Content += people.name; this.backUrl = backUrl; if (this.backUrl.Last() == "") { backButton.Visibility = Visibility.Hidden; } else { backButton.Visibility = Visibility.Visible; } mass.Content += ' ' + people.mass; height.Content += ' ' + people.height; birth.Content += ' ' + people.birth_year; eye.Content += ' ' + people.eye_color; gender.Content += ' ' + people.gender; hair.Content += ' ' + people.hair_color; homeworld.Content += ' ' + GetHomeWorld(people.homeworld); skin.Content += ' ' + people.skin_color; created.Content += ' ' + ConvertToDateTime(people.created); edited.Content += ' ' + ConvertToDateTime(people.edited); backButton.Click += GoBack; listFilms.MouseDoubleClick += callFilm; listStarships.MouseDoubleClick += callStarship; listVehicles.MouseDoubleClick += CallVehicule; listFilms.Items.Clear(); listStarships.Items.Clear(); listVehicles.Items.Clear(); foreach (String f in people.films) { listFilms.Items.Add(FilmViewModel.GetFilm(f)); } foreach (String s in people.starships) { listStarships.Items.Add(StarshipViewModel.GetStarship(s)); } foreach (String v in people.vehicles) { listVehicles.Items.Add(VehicleViewModel.GetVehicle(v)); } }
public StarshipPage(String url, List <String> backUrl) { InitializeComponent(); this.backUrl = backUrl; if (this.backUrl.Last() == "") { backButton.Visibility = Visibility.Hidden; } else { backButton.Visibility = Visibility.Visible; } starship = StarshipViewModel.GetStarship(url); name.Content += ' ' + starship.name; model.Content += ' ' + starship.model; manufacturer.Content += ' ' + starship.manufacturer; credits.Content += ' ' + starship.cost_in_credits; lenght.Content += ' ' + starship.length; capacity.Content += ' ' + starship.cargo_capacity; Sclass.Content += ' ' + starship.starship_class; speed.Content += ' ' + starship.max_atmosphering_speed; hyperdrive.Content += ' ' + starship.hyperdrive_rating; consumables.Content += ' ' + starship.consumables; crew.Content += ' ' + starship.crew; passengers.Content += ' ' + starship.passengers; created.Content += ' ' + ConvertToDateTime(starship.created); edited.Content += ' ' + ConvertToDateTime(starship.edited); listFilms.MouseDoubleClick += callFilm; listCharacters.MouseDoubleClick += callPeople; listFilms.Items.Clear(); listCharacters.Items.Clear(); backButton.Click += GoBack; foreach (String f in starship.films) { listFilms.Items.Add(FilmViewModel.GetFilm(f)); } foreach (String p in starship.pilots) { listCharacters.Items.Add(PeopleViewModel.GetPeople(p)); } }