private void RetrieveData() { if (Showtimes == null) { Showtimes = new ObservableCollection <Showtime>(); } var showtimes = repository.GetPendingShowtimes(Movie.Id).ToList(); Showtimes.Clear(); showtimes.ForEach(showtime => Showtimes.Add(showtime)); }
public void CreateShowtime(Theater theater, Movie movie, string time) { var newShowtime = new Showtime() { Cinema = this, Theater = theater, Movie = movie, Time = time }; Showtimes.Add(newShowtime); MakeTickets(newShowtime); }
// because we made the defition private we are using this method to add the showtimes.. this is a setter public void AddShowtime(string time) { Showtimes.Add(time, MaxSeats); }