Exemplo n.º 1
0
 public LocationListViewModel(MainWindow view)
 {
     _locationRepository = view.LocationRepository;
     _filmRepository     = view.FilmRepository;
     Locations           = new ObservableCollection <Location>(_locationRepository.List());
     CurrentLocation     = _locationRepository.List().FirstOrDefault();
 }
Exemplo n.º 2
0
        internal void SetLocation()
        {
            List <string> descriptions = new List <string>();

            foreach (Location l in _locationRepository.List())
            {
                descriptions.Add(l.Description);
            }
            StringChooser chooser = new StringChooser(descriptions);

            chooser.ShowDialog();
            if (chooser.Accept)
            {
                string   description = chooser.ChosenString;
                Location loc         = _locationRepository.GetByDescription(description);
                CurrentFilm.Location = loc;
            }
        }
Exemplo n.º 3
0
 internal void Delete()
 {
     _locationRepository.Delete(CurrentLocation);
     CurrentLocation = _locationRepository.List().FirstOrDefault();
 }