async void onPinClick(Object sender, SelectedPinChangedEventArgs e)
        {
            if (e.SelectedPin != null)
            {
                int selectedID = Int32.Parse(e.SelectedPin.Label);
                Models.ActiveRequest request = null;
                foreach (var req in requests)
                {
                    if (req.ID == selectedID)
                    {
                        request = req;
                    }
                }

                Debug.WriteLine("Ride ID = " + request.ID);
                string startAddr = await getAddress(request.StartLocation);

                string destAddr = await getAddress(request.EndLocation);

                //Display info about request and option to accept ride
                var accept = await DisplayAlert("Accept this ride?", "Location: " + startAddr + "\n\nDestination: " + destAddr + "\n\nRequest time: " + request.StartTime.ToString() + "\n\nNumber of Passengers: " + request.NumPassangers, "Yes", "No");

                if (accept)
                {
                    acceptRide(request, destAddr);
                }
            }
        }
Exemple #2
0
        private void map_SelectedPinChanged(object sender, SelectedPinChangedEventArgs e)
        {
            if (e.SelectedPin == null)
            {
                return;
            }

            var index = map.Pins.IndexOf(e.SelectedPin);

            ATMPlacesListView.SelectedItem = atmLocations[index];
        }
Exemple #3
0
        async void Map_SelectedPinChanged(object sender, SelectedPinChangedEventArgs e)
        {
            DataTemplate template = DetailTemplate;

            if (e.SelectedPin == null)
            {
                return;
            }

            Page detailPage;

            if (template == null)
            {
                detailPage = new DataPage();
            }
            else
            {
                detailPage = (Page)CreateContent2(template, e.SelectedPin.Tag, this);
            }

            detailPage.BindingContext = e.SelectedPin.Tag;
            await Navigation.PushAsync(detailPage);
        }
Exemple #4
0
        void SelectedPin_Changed(object sender, SelectedPinChangedEventArgs e)
        {
            var time = DateTime.Now.ToString("hh:mm:ss");

            labelStatus.Text = $"[{time}]SelectedPin changed - {e?.SelectedPin?.Label ?? "nothing"}";
        }
 private void OnSelectedPinChanged(object sender, SelectedPinChangedEventArgs args)
 {
     Command?.Execute(args);
 }
 void SelectedPin_Changed(object sender, SelectedPinChangedEventArgs e)
 {
     labelStatus.Text = $"SelectedPin changed - {e?.SelectedPin?.Label ?? "nothing"}";
 }
Exemple #7
0
 private void Map_SelectedPinChanged(object sender, SelectedPinChangedEventArgs e)
 {
     //this.Navigation.PushAsync(new ProveedorPage(e.SelectedPin.Tag as ServiceReference1.Proveedor));
 }
Exemple #8
0
 //Do something when a pin is clicked, experimental
 private void Map_SelectedPinChanged(object sender, SelectedPinChangedEventArgs e)
 {
     Pin currentPinSelected = e.SelectedPin;
 }