private async void OnCancelTapped(object sender, EventArgs e) { try { await CloseView(); if (Device.OS == TargetPlatform.Android) { AndroidMapView.ShowLocator(); var formsMap = (AndroidMapView)SplitView.MapView; SplitView.Fullmapview.FindByName <Grid>("GlMapView").Children.Add(formsMap, 0, 0); SplitView.MapView.LoadPins(AppContext.AppContext.LstGooglePin); } _cts.Cancel(); } catch (Exception ex) { LogTracking.LogTrace(ex.ToString()); } }
private async void CloseView() { try { await SplitView.Instace().PopRightContent(); //Dispose Map pinMapView?.DisposeMap(); GC.Collect(0, GCCollectionMode.Forced); // FullMapView.NewCaseAddView = null; AppContext.AppContext.NewRecordInProgress = false; if (Device.OS == TargetPlatform.Android) { AndroidMapView.ShowLocator(); } } catch (Exception ex) { LogTracking.LogTrace(ex.ToString()); } }