public async void removeBottomSheetWhenViewingAUser() { //Get rid of bottom sheet if its there var window = UIApplication.SharedApplication.KeyWindow; var rootVC = window.RootViewController; if (rootVC is BottomSheetViewController) { BottomSheetViewController bottomSheet = (BottomSheetViewController)rootVC; await bottomSheet.slideMenuToLeft(); bottomSheet.StopTimers(); bottomSheet.Dispose(); bottomSheet = null; window.RootViewController = rootVC.ChildViewControllers[0]; } else { PotentialMatchesBottomSheetViewController matchesSheet = (PotentialMatchesBottomSheetViewController)rootVC; await matchesSheet.slideMenuToLeft(); matchesSheet.StopTimers(); matchesSheet.Dispose(); matchesSheet = null; window.RootViewController = rootVC.ChildViewControllers[0]; } }
public TableSource(CustomPin pin, CustomMap map, MKMapView nativeMap, BottomSheetViewController owner, CustomMapRenderer customMapRenderer) { this.nativeMap = nativeMap; this.map = map; this.pin = pin; this.owner = owner; organs = pin.Url.Split(','); userId = Int32.Parse(organs[organs.Length - 1]); organs = organs.Take(organs.Length - 1).ToArray(); Cells = new Dictionary<string, UITableViewCell>(); this.customMapRenderer = customMapRenderer; }
void BackButton_TouchUpInside(object sender, EventArgs e) { customMapRenderer.ClearAllReceivers(); customMapRenderer.removeOverlays(); StopTimers(); var window = UIApplication.SharedApplication.KeyWindow; var bottomSheetVC = new BottomSheetViewController(customPin, map, nativeMap, customMapRenderer); bottomSheetVC.AddChildViewController(window.RootViewController.ChildViewControllers[0]); window.RootViewController = bottomSheetVC; }
public async Task addSlideUpSheet(CustomPin pin, CustomMap map, MKMapView nativeMap, CustomMapRenderer customMapRenderer) { //Get the current UI Window var window = UIApplication.SharedApplication.KeyWindow; BottomSheetViewController bottomSheetVC = new BottomSheetViewController(pin, map, nativeMap, customMapRenderer); var rootVC = window.RootViewController; if (rootVC != null) { bottomSheetVC.AddChildViewController(rootVC); } window.RootViewController = bottomSheetVC; }
public async void removeBottomSheet(bool isPresented, MasterPageItem selectedMenuItem) { UIApplication.SharedApplication.InvokeOnMainThread(async() => { var window = UIApplication.SharedApplication.KeyWindow; var rootVC = window.RootViewController; if (!isPresented) { if (selectedMenuItem.TargetType != typeof(ClinicianMapPage)) { if (rootVC is BottomSheetViewController) { currentBottomSheet.StopTimers(); currentBottomSheet.Dispose(); currentBottomSheet = null; window.RootViewController = rootVC.ChildViewControllers[0]; } else if (rootVC is PotentialMatchesBottomSheetViewController) { currentPotentialMatchesBottomSheet.StopTimers(); currentPotentialMatchesBottomSheet.Dispose(); currentPotentialMatchesBottomSheet = null; window.RootViewController = rootVC.ChildViewControllers[0]; } else { return; } } else { if (currentBottomSheet != null) { window.RootViewController = currentBottomSheet; await currentBottomSheet.slideMenuBackInFromRight(); } else if (currentPotentialMatchesBottomSheet != null) { window.RootViewController = currentPotentialMatchesBottomSheet; await currentPotentialMatchesBottomSheet.slideMenuBackInFromRight(); } else { return; } } } else { if (rootVC is BottomSheetViewController) { BottomSheetViewController bottomSheet = (BottomSheetViewController)rootVC; currentBottomSheet = bottomSheet; await bottomSheet.slideMenuToRight(); } else if (rootVC is PotentialMatchesBottomSheetViewController) { PotentialMatchesBottomSheetViewController matchesSheet = (PotentialMatchesBottomSheetViewController)rootVC; currentPotentialMatchesBottomSheet = matchesSheet; await matchesSheet.slideMenuToRight(); } else { //if (currentBottomSheet != null) //{ // currentBottomSheet.StopTimers(); // currentBottomSheet.Dispose(); // currentBottomSheet = null; // window.RootViewController = rootVC.ChildViewControllers[0]; //} //else if (currentPotentialMatchesBottomSheet != null) //{ // currentPotentialMatchesBottomSheet.StopTimers(); // currentPotentialMatchesBottomSheet.Dispose(); // currentPotentialMatchesBottomSheet = null; // window.RootViewController = rootVC.ChildViewControllers[0]; //} //else //{ return; //} } } }); }