Esempio n. 1
0
        private async void refreshInfo()
        {
            absLayout.ItemsSource = null;
            masterCoupons         = new List <CouponSchedule>();
            GetGPS   _gps       = new GetGPS();
            Location myLocation = await _gps.updateLocation();

            if (myLocation == null)
            {
                myLocation.lat = 43.217703;
                myLocation.lng = -79.861937;
            }

            masterCoupons = await _google.GoogleNearby(myLocation);

            //masterCoupons = filterCoupons(masterCoupons);
            couponList.couponList = masterCoupons;
            int i = 0;

            masterCoupons = _google.GoogleImages(masterCoupons);
            foreach (var n in masterCoupons)
            {
                n.OnFindCoupon += new CouponSchedule.FindCouponHandler(FindThisPlace);
                Console.WriteLine("TypeLink  ====>  " + n.thisCoupon.TypeLink);
                if (n.thisCoupon.ImageStream != null)
                {
                    fixedCoupons.Add(n);
                }

                i++;
            }

            absLayout.ItemsSource = fixedCoupons;
            BindingContext        = fixedCoupons;
        }