public void HideOverlay() { if (PageState == MainPageState.Overlay) { IOverlayPlugin ctrl = OverlayPlugin; if (ctrl != null) { ctrl.SignalClosure(); } PageState = MainPageState.Root; Overlay.Child = null; } }
protected override void OnBackKeyPress(CancelEventArgs e) { if (PageState == MainPageState.Overlay) { IOverlayPlugin ctrl = OverlayPlugin; if (ctrl != null) { e.Cancel = ctrl.GoBack(); } } else if (rootView != null) { if (!IgnoreBackButton) { bool backActionHandled = false; // find view to handle back anchor View handler = rootView.FindBackKeyDelegate(); if (handler == null) { handler = rootView; } // ask subscribed block to handle the back anchor backActionHandled = handler.HandleBackKey(); // go back (or not) e.Cancel = backActionHandled ? true : GoBack(); } else { e.Cancel = true; } } }