Beispiel #1
0
        private async void Start_GetLocation()
        {
            ApplicationBar.IsMenuEnabled = false;
            pivotControl.Margin          = new Thickness(-15, 17, 0, 0);

            if (!isUpdating)
            {
                spinnerSP.Visibility = Visibility.Visible;
                SpinningAnimation.Begin();
            }

            position = await App.GetLocation(Dispatcher, isUpdating);

            if (position != null)
            {
                SystemTray.ProgressIndicator.IsVisible = false;

                SpinningAnimation.Stop();
                spinnerSP.Visibility = Visibility.Collapsed;

                SearchRange();
            }
            else
            {
                Dispatcher.BeginInvoke(() => { lastRB = null; });

                RB_Enabler(true, false);
            }

            ApplicationBar.IsMenuEnabled = true;
            pivotControl.Margin          = new Thickness(-15, 0, 0, 0);
        }
Beispiel #2
0
        private async void Start_GetLocation()
        {
            SpinningAnimation.Begin();
            position = await App.GetLocation(this.Dispatcher, false);

            if (position != null)
            {
                if (await Task.Run(() => NetworkInterface.GetIsNetworkAvailable()))
                {
                    geoCoordenadas = new List <GeoCoordinate>();
                    geoCoordenadas.Add(position.Coordinate.ToGeoCoordinate());

                    SystemTray.ProgressIndicator.Text = AppResources.SysTray_Trajeto;

                    Start_ReverseGeocodeQuery();
                }
                else
                {
                    MessageBox.Show(AppResources.Trajeto_SemConexao_Msg,
                                    AppResources.Trajeto_SemConexao_Title,
                                    MessageBoxButton.OK);

                    Dispatcher.BeginInvoke(() =>
                    {
                        NavigationService.GoBack();
                    });
                }
            }
            else
            {
                Dispatcher.BeginInvoke(() =>
                {
                    NavigationService.GoBack();
                });
            }
        }