コード例 #1
0
        public ArrivalsDataSource(FlightsViewModel viewModel)
        {
            _viewModel = viewModel;

            _viewModel.Arrivals.CollectionChanged += (o, e) => {
                if(TableView != null)
                    TableView.ReloadData();
            };
        }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     viewModel = TinyIoC.TinyIoCContainer.Current.Resolve<FlightsViewModel>();
     ListAdapter = new Adapters.FlightsAdapter(this, viewModel.Arrivals);
 }