public UIKit.UIViewController GetViewControllerForAdaptivePresentation (UIPresentationController controller, UIModalPresentationStyle style) { /* Load and return the adapted view controller from the Detail storyboard. That storyboard is stored within the same bundle that contains this class. */ var adaptableFormSheetSegueBundle = NSBundle.FromClass (new Class (typeof(AdaptableFormSheetSegue))); return UIStoryboard.FromName ("Detail", adaptableFormSheetSegueBundle).InstantiateViewController ("Adapted"); }
public static Task ShowModal( UIViewController parentViewController, UIView view, UIModalPresentationStyle presentationStyle = UIModalPresentationStyle.FormSheet, UIModalTransitionStyle transitionStyle = UIModalTransitionStyle.CoverVertical, Action completionHandler = null, bool dismissOnTapOutside = true, bool disposeOnFinish = false ) { return(ShowModal( parentViewController, new UIViewController { View = view }, presentationStyle, transitionStyle, completionHandler, dismissOnTapOutside, disposeOnFinish )); }
public static Task ShowModal <TViewController>( UIViewController parentViewController, TViewController viewController, Action <TViewController, Action> dismissSubscriber, UIModalPresentationStyle presentationStyle = UIModalPresentationStyle.FormSheet, UIModalTransitionStyle transitionStyle = UIModalTransitionStyle.CoverVertical, Action completionHandler = null, bool dismissOnTapOutside = true, bool disposeOnFinish = false ) where TViewController : UIViewController { return(ShowModal <TViewController, object>( parentViewController, viewController, dismissSubscriber, presentationStyle, transitionStyle, completionHandler, (vc) => null, dismissOnTapOutside, disposeOnFinish )); }
public static Task ShowModal( UIViewController parentViewController, UIViewController viewController, UIModalPresentationStyle presentationStyle = UIModalPresentationStyle.FormSheet, UIModalTransitionStyle transitionStyle = UIModalTransitionStyle.CoverVertical, Action completionHandler = null, bool dismissOnTapOutside = true, bool disposeOnFinish = false ) { return(ShowModal <ModalFrameController>( parentViewController, new ModalFrameController(viewController), (mfc, dismissAction) => { mfc.DoneAction = dismissAction; }, presentationStyle, transitionStyle, completionHandler, dismissOnTapOutside, disposeOnFinish )); }
static void SetModalPresentationStyle(BindableObject element, UIModalPresentationStyle value) { element.SetValue(ModalPresentationStyleProperty, value); }
/// <include file="../../../../docs/Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific/Page.xml" path="//Member[@MemberName='SetModalPresentationStyle']/Docs" /> public static IPlatformElementConfiguration <iOS, FormsElement> SetModalPresentationStyle(this IPlatformElementConfiguration <iOS, FormsElement> config, UIModalPresentationStyle value) { SetModalPresentationStyle(config.Element, value); return(config); }
public static UIViewController GetAdaptivePresentationStyle(IUIAdaptivePresentationControllerDelegate This, UIPresentationController controller, UIModalPresentationStyle style) { return(null); }
public override UIViewController GetAdaptivePresentationStyle(UIPresentationController controller, UIModalPresentationStyle style) { return(null); }
/// <summary> /// Creates a new instance of <see cref="UIViewControllerSectionsTransitionInfo"/>. /// </summary> /// <param name="allowDismissFromGesture">See <see cref="AllowDismissFromGesture"/>.</param> /// <param name="modalPresentationStyle">See <see cref="ModalPresentationStyle"/>.</param> /// <param name="modalTransitionStyle">See <see cref="ModalTransitionStyle"/>.</param> public UIViewControllerSectionsTransitionInfo(bool allowDismissFromGesture = true, UIModalPresentationStyle modalPresentationStyle = UIModalPresentationStyle.PageSheet, UIModalTransitionStyle modalTransitionStyle = UIModalTransitionStyle.CoverVertical) { AllowDismissFromGesture = allowDismissFromGesture; ModalPresentationStyle = modalPresentationStyle; ModalTransitionStyle = modalTransitionStyle; }
public override UIViewController GetViewControllerForAdaptivePresentation(UIPresentationController controller, UIModalPresentationStyle style) { return(new UINavigationController(controller.PresentedViewController)); }
public static async Task <TResult> ShowModal <TViewController, TResult>( UIViewController parentViewController, TViewController viewController, Action <TViewController, Action> dismissSubscriber = null, UIModalPresentationStyle presentationStyle = UIModalPresentationStyle.FormSheet, UIModalTransitionStyle transitionStyle = UIModalTransitionStyle.CoverVertical, Action completionHandler = null, Func <TViewController, TResult> resultGetter = null, bool dismissOnTapOutside = true, bool disposeOnFinish = false ) where TViewController : UIViewController { try { if (completionHandler == null) { completionHandler = Tools.Lambda.NoOp; } if (dismissOnTapOutside && presentationStyle.IsIn(UIModalPresentationStyle.FullScreen, UIModalPresentationStyle.OverFullScreen)) { dismissOnTapOutside = false; } if (dismissSubscriber == null && dismissOnTapOutside == false) { throw new ArgumentException("dismissSubscriber is null and dismissOnTapOutside is effectively false, this will result in an unclosable modal screen"); } var signal = new ManualResetEventSlim(); viewController.ModalPresentationStyle = presentationStyle; viewController.ModalTransitionStyle = transitionStyle; Action dismissModalDialogAction = signal.Set; dismissSubscriber(viewController, dismissModalDialogAction); var currentPresentedController = parentViewController.FindPresentedViewController(); if (currentPresentedController != null) { parentViewController = currentPresentedController; } viewController.ProvidesPresentationContextTransitionStyle = true; viewController.DefinesPresentationContext = true; await parentViewController.PresentViewControllerAsync(viewController, true); completionHandler(); var window = parentViewController.View.Window; UITapGestureRecognizerEx tapOutsideGesture = null; if (dismissOnTapOutside) { tapOutsideGesture = new UITapGestureRecognizerEx(async(x) => { if (x.State == UIGestureRecognizerState.Ended) { var location = x.LocationInView(null);//Passing nil gives us coordinates in the window if (!viewController.View.PointInside(viewController.View.ConvertPointFromView(location, window), null)) { //Convert tap location into the local view's coordinate system. If outside, dismiss the view. signal.Set(); } } }); tapOutsideGesture.NumberOfTapsRequired = 1; tapOutsideGesture.CancelsTouchesInView = false; window.AddGestureRecognizer(tapOutsideGesture); } await Task.Run(() => signal.Wait()); if (dismissOnTapOutside) { window.RemoveGestureRecognizer(tapOutsideGesture); } if (!viewController.IsBeingDismissed && parentViewController.ModalViewController == viewController) { await viewController.DismissViewControllerAsync(true); } return(resultGetter == null ? default(TResult) : resultGetter(viewController)); } finally { if (disposeOnFinish) { viewController.Dispose(); } } }
public UIKit.UIViewController GetViewControllerForAdaptivePresentation(UIPresentationController controller, UIModalPresentationStyle style) { /* * Load and return the adapted view controller from the Detail storyboard. * That storyboard is stored within the same bundle that contains this * class. */ var adaptableFormSheetSegueBundle = NSBundle.FromClass(new Class(typeof(AdaptableFormSheetSegue))); return(UIStoryboard.FromName("Detail", adaptableFormSheetSegueBundle).InstantiateViewController("Adapted")); }
public UIViewController GetViewControllerForAdaptivePresentation(UIPresentationController controller, UIModalPresentationStyle style) { var navController = new UINavigationController(controller.PresentedViewController); if (navController != null) { var closeText = GetPopoverCloseText(navController.TopViewController); doneItem = new UIBarButtonItem(closeText, UIBarButtonItemStyle.Done, null); doneItem.Clicked += DoneTapped; navController.TopViewController.NavigationItem.RightBarButtonItem = doneItem; } return(navController); }
public static UIViewController GetAdaptivePresentationStyle(IUIAdaptivePresentationControllerDelegate This, UIPresentationController controller, UIModalPresentationStyle style) { return null; }
public virtual UIViewController GetAdaptivePresentationStyle(UIPresentationController controller, UIModalPresentationStyle style) { return null; }