public ArrivalsDataSource(FlightsViewModel viewModel) { _viewModel = viewModel; _viewModel.Arrivals.CollectionChanged += (o, e) => { if(TableView != null) TableView.ReloadData(); }; }
public void Setup() { _lakselvAirport = new Airport("LKL", "Lakselv"); _trondheimAirport = new Airport("TRD", "Trondheim"); _flightsService = new FlightsServiceStub(); _objectStore = new ObjectStoreStub(); _messenger = new TinyMessengerHub(); _dispatcher = new DispatchAdapter(); _viewModel = new FlightsViewModel(_flightsService, _objectStore, _messenger, _dispatcher); }
public void Loads_selected_airport_if_saved_to_disk() { _objectStore.Save(_lakselvAirport, Airport.SelectedAirportFilename); _viewModel = new FlightsViewModel(_flightsService, _objectStore, _messenger, _dispatcher); Assert.AreEqual(_lakselvAirport.Code, _viewModel.SelectedAirport.Code); }
public void Finds_nearest_airport_if_option_is_selected() { _objectStore.Save(Airport.Nearest, Airport.SelectedAirportFilename); bool findNearestWasPublished = false; _messenger.Subscribe<FindNearestAirportMessage>(m => findNearestWasPublished = true); _viewModel = new FlightsViewModel(_flightsService, _objectStore, _messenger, _dispatcher); Assert.IsTrue(findNearestWasPublished); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); viewModel = TinyIoC.TinyIoCContainer.Current.Resolve<FlightsViewModel>(); ListAdapter = new Adapters.FlightsAdapter(this, viewModel.Arrivals); }