public LocationListView(MainWindow view) { InitializeComponent(); _locationRepository = view.LocationRepository; Model = view.LocationModel; DataContext = Model; }
internal void Find() { StringDialog dialog = new StringDialog("A partial description"); dialog.ShowDialog(); if (dialog.Accept) { string description = dialog.YourString; AbstractLocationRepository lRepo = _locationRepository; Location loc = null; try { loc = lRepo.GetByDescription(description); } catch (Exception ex) { ReportIt("The description must specify a unique location"); } if (loc != null) { LocationView view = new LocationView(this); view.ShowDialog(); } } }
public LocationListViewModel(MainWindow view) { _locationRepository = view.LocationRepository; _filmRepository = view.FilmRepository; Locations = new ObservableCollection <Location>(_locationRepository.List()); CurrentLocation = _locationRepository.List().FirstOrDefault(); }
public FilmListViewModel(MainWindow view) { _mainView = view; _countryRepository = view.CountryRepository; _filmCountryRepository = view.FilmCountryRepository; _filmPersonRepository = view.FilmPersonRepository; _filmRepository = view.FilmRepository; _locationRepository = view.LocationRepository; _personRepository = view.PersonRepository; Films = new ObservableCollection <Film>(_filmRepository.List()); CurrentFilm = _filmRepository.List().FirstOrDefault(); }