public PositionControl() { InitializeComponent(); lon.CoordinateValueChanged += new CoordinateValueChangedHandler(lon_CoordinateValueChanged); lat.CoordinateValueChanged += new CoordinateValueChangedHandler(lat_CoordinateValueChanged); AllowDrop = true; this.PreviewDragOver += new DragEventHandler(PositionControl_PreviewDragEnter); this.PreviewDragEnter += new DragEventHandler(PositionControl_PreviewDragEnter); this.Drop += new DragEventHandler(PositionControl_Drop); this.DragEnter += new DragEventHandler(PositionControl_DragEnter); this.DragOver += new DragEventHandler(PositionControl_DragEnter); HookLatLongControl(lat); HookLatLongControl(lon); grid.RowDefinitions[0].Height = new GridLength(0); grid.RowDefinitions[1].Height = new GridLength(0); grid.ColumnDefinitions[1].Width = new GridLength(68); lblLon.Visibility = System.Windows.Visibility.Visible; if (GoogleEarth.IsInstalled()) { grid.ColumnDefinitions[5].Width = new GridLength(4); grid.ColumnDefinitions[6].Width = new GridLength(23); } else { grid.ColumnDefinitions[5].Width = new GridLength(0); grid.ColumnDefinitions[6].Width = new GridLength(0); } }
private void btnGoogleCode_Click(object sender, RoutedEventArgs e) { GoogleEarth.GeoTag((lat, lon, altitude) => { this.lat.Value = lat; this.lon.Value = lon; if (this.LocationChanged != null) { LocationChanged(lat, lon, altitude, "m", null, "Google Earth"); } }, this.lat.Value, this.lon.Value); }