Ejemplo n.º 1
0
        async private Task UpdateTripDisplays()
        {
            iOSLoginManager loginManager = iOSLoginManager.Instance;

            int id = loginManager.GetTravelerId();

            int  maxRecords = 1;
            bool retina     = (UIScreen.MainScreen.Scale > 1.0);

            if (retina)
            {
                if (UIScreen.MainScreen.Bounds.Size.Height > 480.0f)
                {
                    maxRecords = 3;
                }
            }

            int upcomingTripCount = await mUserTripManager.GetUpcomingTripCount(id);

            if (upcomingTripCount > maxRecords)
            {
                btnMoreTrips.Hidden = false;
            }
            else
            {
                btnMoreTrips.Hidden = true;
            }

            mNextTrip = await mHomeDataManager.GetNextTrip(id);

            updateNextTripDisplay(mNextTrip);

            List <Trip> trips = await mUserTripManager.GetUpcomingTripsAfterNext(id, maxRecords);

            UpcomingTripsTableSource tableSource = new UpcomingTripsTableSource(trips, new TripTableCellHomeScreen(""));

            tableSource.TripSelected += (Trip trip) => {
                mTripSelected = trip;
                PerformSegue("TripDetailsSegue", this);
            };


            tableUpcomingTrips.Source = tableSource;
            tableUpcomingTrips.ReloadData();
            dismissLoading();
        }
Ejemplo n.º 2
0
        async private Task loadData()
        {
            iOSLoginManager loginManager = iOSLoginManager.Instance;

            int travelerId = loginManager.GetTravelerId();

            List <Trip> trips = await mUserTripManager.GetUpcomingTrips(travelerId, 25);

            UpcomingTripsTableSource tableSource = new UpcomingTripsTableSource(trips, new TripTableCell(""));

            tableSource.TripSelected += (Trip trip) => {
                mTripSelected = trip;
                PerformSegue("TripDetailsSegue", this);
            };


            tableViewUpcomingTrips.Source = tableSource;
            tableViewUpcomingTrips.ReloadData();
        }