C# GPS信号弱时禁用功能

C# GPS信号弱时禁用功能,c#,windows-phone-8,C#,Windows Phone 8,我正在开发一个WP8应用程序,我想禁用一些功能,直到手机找不到我的位置。 有什么方法可以做到这一点吗?先禁用它,然后询问当前位置,当它的状态改变时,启用你的东西 这里有一个例子: // Event handler for the GeoCoordinateWatcher.StatusChanged event. void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e) { switch (

我正在开发一个WP8应用程序,我想禁用一些功能,直到手机找不到我的位置。
有什么方法可以做到这一点吗?

先禁用它,然后询问当前位置,当它的状态改变时,启用你的东西

这里有一个例子:

// Event handler for the GeoCoordinateWatcher.StatusChanged event.
void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
{
    switch (e.Status)
    {
        case GeoPositionStatus.Disabled:
            // The Location Service is disabled or unsupported.
            // Check to see whether the user has disabled the Location Service.
            if (watcher.Permission == GeoPositionPermission.Denied)
            {
                // The user has disabled the Location Service on their device.
                statusTextBlock.Text = "you have this application access to location.";
            }
            else
            {
                statusTextBlock.Text = "location is not functioning on this device";
            }
            break;

        case GeoPositionStatus.Initializing:
            // The Location Service is initializing.
            // Disable the Start Location button.
            startLocationButton.IsEnabled = false;
            break;

        case GeoPositionStatus.NoData:
            // The Location Service is working, but it cannot get location data.
            // Alert the user and enable the Stop Location button.
            statusTextBlock.Text = "location data is not available.";
            stopLocationButton.IsEnabled = true;
            break;

        case GeoPositionStatus.Ready:
            // The Location Service is working and is receiving location data.
            // Show the current position and enable the Stop Location button.
            statusTextBlock.Text = "location data is available.";
            stopLocationButton.IsEnabled = true;
            break;
    }
}