Пример #1
0
        public async Task <DateTime?> ShowDatePickerAsync(string title, DateTime?defaultDate, DateTime?minDate = null, DateTime?maxDate = null)
        {
            if (_tcsDate == null)
            {
                _tcsDate = new TaskCompletionSource <DateTime?>();

                _datePickerViewController.SetupDatePicked(title, UIKit.UIDatePickerMode.Date, defaultDate, minDate, maxDate);
                await TopViewController.PresentViewControllerAsync(_datePickerViewController, true);
            }
            return(await _tcsDate.Task);
        }
Пример #2
0
        private void showModalDialogViewController(Type viewType, MvxBasePresentationAttribute attribute, MvxViewModelRequest request)
        {
            var viewController = (UIViewController)this.CreateViewControllerFor(request);

            viewController.ModalPresentationStyle = UIModalPresentationStyle.Custom;
            viewController.TransitioningDelegate  = modalTransitionDelegate;

            TopViewController.PresentViewController(viewController, true, null);

            ModalViewControllers.Add(viewController);
        }
Пример #3
0
        private void showModalCardViewController(Type viewType, MvxBasePresentationAttribute attribute, MvxViewModelRequest request)
        {
            var viewController     = (UIViewController)this.CreateViewControllerFor(request);
            var transitionDelegate = new FromBottomTransitionDelegate(
                () => ModalViewControllers.Remove(viewController)
                );

            viewController.ModalPresentationStyle = UIModalPresentationStyle.Custom;
            viewController.TransitioningDelegate  = transitionDelegate;

            TopViewController.PresentViewController(viewController, true, null);

            ModalViewControllers.Add(viewController);
        }
Пример #4
0
        public async Task <TimeSpan?> ShowTimePickerAsync(string title, DateTime?defaultDate, DateTime?minDate = null, DateTime?maxDate = null)
        {
            if (_tcsDate == null)
            {
                _tcsDate = new TaskCompletionSource <DateTime?>();

                _datePickerViewController.SetupDatePicked(title, UIKit.UIDatePickerMode.Time, defaultDate, minDate, maxDate);
                await TopViewController.PresentViewControllerAsync(_datePickerViewController, true);
            }
            var date = await _tcsDate.Task;

            if (date.HasValue)
            {
                return(date.Value.TimeOfDay);
            }
            return(null);
        }
Пример #5
0
 public override UIInterfaceOrientation PreferredInterfaceOrientationForPresentation()
 {
     return(TopViewController.PreferredInterfaceOrientationForPresentation());
 }
Пример #6
0
 public override bool ShouldAutorotate()
 {
     return(TopViewController.ShouldAutorotate());
 }
Пример #7
0
 public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
 {
     return(this.TopViewController != null
                         ? TopViewController.GetSupportedInterfaceOrientations()
                         : base.GetSupportedInterfaceOrientations());
 }
Пример #8
0
 /// <summary>
 /// The orientations supported by this <see cref="T:UIKit.UIViewController" />.
 /// </summary>
 /// <returns>
 /// A <see cref="T:UIKit.UIInterfaceOrientationMask" /> of the orientations supported by this <see cref="T:UIKit.UIViewController" />.
 /// </returns>
 /// <remarks>
 /// <para>When the user changes the device orientation, the system calls this method on the root view controller or the top most presented view controller that fills the window. If the view controller supports the new orientation, the window and view controller are rotated to the new orientation. This method is only called if the view controller'€™s should Auto rotate method returns YES.</para>
 /// <para>Override this method to report all of the orientations that the view controller supports. The default values for a view controller'€™s supported interface orientations is set to UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone idiom.</para>
 /// <para>The system intersects the view controller'€™s supported orientations with the app's supported orientations (as determined by the Info.PLIST file or the app delegate's application:supportedInterfaceOrientationsForWindow: method) to determine whether to rotate.
 /// </para>
 /// </remarks>
 public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
 {
     return(TopViewController.GetSupportedInterfaceOrientations());
 }
 public override UIViewController PopViewController(bool animated)
 {
     TopViewController?.Dispose();
     return(base.PopViewController(animated));
 }
Пример #10
0
 private void Awake()
 {
     bull               = FindObjectOfType <TopViewController>();
     adrenalineFill     = transform.Find("Adrenaline Bar/Adrenaline").GetComponent <Image>();
     adrenalineGoalFill = transform.Find("Adrenaline Bar/Adrenaline Goal").GetComponent <Image>();
 }