Exemplo n.º 1
0
        private void btnGuidanceWalkTask_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                GuidanceWalkTask walkTo = new GuidanceWalkTask();
                //GuidanceDriveTask driveTo = new GuidanceDriveTask();

                walkTo.Destination = new GeoCoordinate(LatitudSevilla, LongitudSevilla);
                walkTo.Title = "Sevilla";
                walkTo.Show();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error message: " + ex.Message);
            }
        }
        private void Button_gridbut_Click(object sender, RoutedEventArgs e)
        {
            if (sender == Driveto)
            {
                try
                {
                    GuidanceDriveTask driveTo = new GuidanceDriveTask();

                    driveTo.Destination = new GeoCoordinate(Double.Parse(LatitudeBox.Text), Double.Parse(LongittudeBox.Text));
                    driveTo.Title = StringBox.Text;
                    driveTo.Show();
                }
                catch (Exception erno)
                {
                    MessageBox.Show("Error message: " + erno.Message);
                }
            }
            else if (sender == Walkto)
            {
                try
                {
                    GuidanceWalkTask walkTo = new GuidanceWalkTask();

                    walkTo.Destination = new GeoCoordinate(Double.Parse(LatitudeBox.Text), Double.Parse(LongittudeBox.Text));
                    walkTo.Title = StringBox.Text;
                    walkTo.Show();
                }
                catch (Exception erno)
                {
                    MessageBox.Show("Error message: " + erno.Message);
                }
            }
            else if (sender == getGeoButton)
            {
                NavigationService.Navigate(new Uri("/LocationSelectorPage.xaml?target=Destination", UriKind.Relative));
            }
        }