Ejemplo n.º 1
0
        private static ICollection <PizzaRestaurantViewModel> CreatePizzaRestaurantsAndPizzaGroups(List <Venue> data)
        {
            List <PizzaRestaurantViewModel> restaurants = new List <PizzaRestaurantViewModel>();

            foreach (Venue venue in data)
            {
                foreach (object cat in venue.Categories)
                {
                    if (cat.ToString().Contains("Pizza") || cat.ToString().Contains("Restaurant") ||
                        cat.ToString().Contains("Bakery") || cat.ToString().Contains("Diner"))
                    {
                        var pizzaRestaurant = new PizzaRestaurantViewModel
                                              (
                            venue.Name,
                            venue.Contact.FormattedPhone,
                            venue.Location.Address,
                            venue.Location.Distance,
                            venue.Location.Country,
                            venue.Location.Lng,
                            venue.Location.Lat,
                            venue.Url,
                            venue.Location.City
                                              );
                        restaurants.Add(pizzaRestaurant);
                    }
                }
            }

            return(restaurants);
        }
Ejemplo n.º 2
0
        private void PizzaMapSearchTapped(object sender, TappedRoutedEventArgs tappedRoutedEventArgs)
        {
            var listView = sender as ListView;

            if (listView != null)
            {
                PizzaRestaurantViewModel data = listView.SelectedItem as PizzaRestaurantViewModel;
                GlobalConfig.SelectedItem = data;
                if (data != null)
                {
                    GlobalConfig.PizzaPlaceLatitude  = data.PizzaLatitude;
                    GlobalConfig.PizzaPlaceLongitude = data.PizzaLongitude;
                    //this.Frame.Navigate(typeof(PizzaMapPoint.PizzaMap));
                    this.Frame.Navigate(typeof(PizzaMap), data);
                }
            }
        }