コード例 #1
0
        private async Task LoadVenues()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;

            Venues.Clear();

            try
            {
                var response = await _foursquare.GetVenues("coffee", CurrentLocation);

                foreach (var v in response.Venues)
                {
                    Venues.Add(v);
                }

                // Publish message that Venues collection has been fully loaded
                MessagingCenter.Send(this, "VenuesLoaded");
            }
            finally
            {
                IsBusy = false;
            }
        }
コード例 #2
0
        private async Task LoadVenues()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;

            Venues.Clear();

            try
            {
                var response = await _foursquare.GetVenues("coffee", CurrentLocation);

                //var response = new VenuesResponse();
                //response.Venues = new List<Venue>();
                //response.Venues.Add(new Venue
                //{
                //    Name = "Test 1",
                //    Id = "1",
                //    Address = new VenueAddress {Address = "123 Main Street", City = "Somewhere", State = "VA"}
                //});
                //response.Venues.Add(new Venue
                //{
                //    Name = "Test 2",
                //    Id = "2",
                //    Address = new VenueAddress {Address = "123 Main Street", City = "Somewhere", State = "VA"}
                //});

                foreach (var v in response.Venues)
                {
                    Venues.Add(v);
                }
            }
            finally
            {
                IsBusy = false;
            }
        }