示例#1
0
        public void ChangeFoodTruckStatus(Object sender, EventArgs args)
        {
            if (foodTruckMapViewModel.IsLocationAvailable() == false)
            {
                DisplayAlert("Alerta", "Por favor ative o GPS!", "OK");
            }
            var position = foodTruckMapViewModel.GetCurrentUserPosition();

            if (loggedFoodTruck.IsOpen == false)
            {
                loggedFoodTruck.IsOpen    = true;
                loggedFoodTruck.Latitude  = position.Latitude;
                loggedFoodTruck.Longitude = position.Longitude;

                this.CreatePin(this.loggedFoodTruck);
            }
            else
            {
                loggedFoodTruck.IsOpen = false;

                this.RemovePin();
            }

            foodTruckOwnerPageViewModel.UpdateFoodTruck(loggedFoodTruck);

            this.ChangeFoodTruckStatusButtonColor();

            this.CreatePins();
        }
示例#2
0
        public FoodTruckMap()
        {
            InitializeComponent();

            this.foodTruckMapViewModel = new FoodTruckMapViewModel();

            if (foodTruckMapViewModel.IsLocationAvailable() == false)
            {
                DisplayAlert("Alerta", "Por favor ative o GPS!", "OK");
            }
            this.userMap = foodTruckMapViewModel.CreateUserMap();

            MapArea.Children.Add(userMap);
            userMap.IsShowingUser = true;

            this.CreatePins();
        }
示例#3
0
        public FoodTruckOwnerPage(FoodTruck foodTruck)
        {
            InitializeComponent();

            this.loggedFoodTruck             = new FoodTruckLoginViewModel().GetFoodTruck(foodTruck.Cnpj);
            this.foodTruckOwnerPageViewModel = new FoodTruckOwnerPageViewModel();
            this.foodTruckMapViewModel       = new FoodTruckMapViewModel();

            if (foodTruckMapViewModel.IsLocationAvailable() == false)
            {
                DisplayAlert("Alerta", "Por favor ative o GPS!", "OK");
            }
            this.userMap = foodTruckMapViewModel.CreateUserMap();

            MapArea.Children.Add(userMap);
            userMap.IsShowingUser = true;

            this.ChangeFoodTruckStatusButtonColor();
            this.CreatePins();
        }