internal void LocationBoxLostFocus(object sender, RoutedEventArgs e) { // lat lon decimal formatter is always supported -even if null if (GeoLocationSupport == null) { Value = NZazuCoordinate.Parse(LocationBox.Text.Trim()); } else { Value = GeoLocationSupport.Parse(LocationBox.Text.Trim()); } }
private static void UpdateControl( GeoLocationBox glb, NZazuCoordinate val, ISupportGeoLocationBox support) { glb.SetToCurrentLocation.Visibility = support != null && support.HasCurrentPosition ? Visibility.Visible : Visibility.Collapsed; glb.OpenInGeoApp.Visibility = support != null && support.CanOpenGeoApp ? Visibility.Visible : Visibility.Collapsed; glb.OpenInGeoApp.IsEnabled = val != null && support != null && support.CanOpenGeoApp; glb.LocationBox.IsEnabled = support != null; glb.LocationBox.Text = support?.ToString(val) ?? "no valid coordinate converter added"; }