private bool Unregister() { //Original comment - "events have to be unregistered on the same thread they were registered on...hence the use of the Queued Task" GroundToGridEvent.Unsubscribe(GroundToGridEventMethod); return(false); }
private async Task <bool> Register() { //Get the active map view. var mapView = MapView.Active; if (mapView?.Map == null) { return(false); } _current_CIMg2g = await mapView.Map.GetGroundToGridCorrection(); if (_current_CIMg2g != null) { _copy_CIMg2g = _current_CIMg2g.CreateCopy(); //make a copy of the G2G right before listening for events } else { _current_CIMg2g = new CIMGroundToGridCorrection(); _copy_CIMg2g = new CIMGroundToGridCorrection(); } GroundToGridEvent.Subscribe(GroundToGridEventMethod); return(true); }