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 VehiclePage(String url, List <String> backUrl) { InitializeComponent(); vehicle = VehicleViewModel.GetVehicle(url); this.backUrl = backUrl; if (this.backUrl.Last() == "") { backButton.Visibility = Visibility.Hidden; } else { backButton.Visibility = Visibility.Visible; } name.Content += ' ' + vehicle.name; model.Content += ' ' + vehicle.model; manufacturer.Content += ' ' + vehicle.manufacturer; credits.Content += ' ' + vehicle.cost_in_credits; lenght.Content += ' ' + vehicle.length; capacity.Content += ' ' + vehicle.cargo_capacity; Sclass.Content += ' ' + vehicle.vehicle_class; speed.Content += ' ' + vehicle.max_atmosphering_speed; consumables.Content += ' ' + vehicle.consumables; crew.Content += ' ' + vehicle.crew; passengers.Content += ' ' + vehicle.passengers; created.Content += ' ' + ConvertToDateTime(vehicle.created); edited.Content += ' ' + ConvertToDateTime(vehicle.edited); listFilms.MouseDoubleClick += callFilm; listCharacters.MouseDoubleClick += callPeople; listFilms.Items.Clear(); listCharacters.Items.Clear(); backButton.Click += GoBack; foreach (String f in vehicle.films) { listFilms.Items.Add(FilmViewModel.GetFilm(f)); } foreach (String p in vehicle.pilots) { listCharacters.Items.Add(PeopleViewModel.GetPeople(p)); } }