public LocationListView(MainWindow view)
 {
     InitializeComponent();
     _locationRepository = view.LocationRepository;
     Model       = view.LocationModel;
     DataContext = Model;
 }
Esempio n. 2
0
        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();
                }
            }
        }
Esempio n. 3
0
 public LocationListViewModel(MainWindow view)
 {
     _locationRepository = view.LocationRepository;
     _filmRepository     = view.FilmRepository;
     Locations           = new ObservableCollection <Location>(_locationRepository.List());
     CurrentLocation     = _locationRepository.List().FirstOrDefault();
 }
Esempio n. 4
0
 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();
 }