Exemplo n.º 1
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			View.BackgroundColor = UIColor.White;
			var mainFrame = new RectangleF (0f, 44f, View.Frame.Width, View.Frame.Height - 44f);
			
			transitionViewController = new TransitionViewController ();
			transitionViewController.View.Frame = mainFrame;
			backViewController = new BackTransitionViewController ();
			backViewController.View.Frame = mainFrame;

			View.AddSubview (transitionViewController.View);

			transitionViewController.SetToolbarVisibility (InterfaceOrientation);
			transitionViewController.TransitionClicked += (s, e) => {
				UIView.Transition(transitionViewController.View, backViewController.View, 0.75,
					transitionViewController.SelectedTransition, null);
			};

			transitionViewController.ContentsClicked += () => {
				if (ContentsButtonClicked != null) {
					ContentsButtonClicked (null, null);
				}
			};
			
			backViewController.BackClicked += (s, e) => {
				UIView.Transition(backViewController.View, transitionViewController.View, 0.75,
					transitionViewController.SelectedTransition, null);
			};
		}
Exemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.White;
            var mainFrame = new RectangleF(0f, 44f, View.Frame.Width, View.Frame.Height - 44f);

            transitionViewController            = new TransitionViewController();
            transitionViewController.View.Frame = mainFrame;
            backViewController            = new BackTransitionViewController();
            backViewController.View.Frame = mainFrame;

            View.AddSubview(transitionViewController.View);

            transitionViewController.SetToolbarVisibility(InterfaceOrientation);
            transitionViewController.TransitionClicked += (s, e) => {
                UIView.Transition(transitionViewController.View, backViewController.View, 0.75,
                                  transitionViewController.SelectedTransition, null);
            };

            transitionViewController.ContentsClicked += () => {
                if (ContentsButtonClicked != null)
                {
                    ContentsButtonClicked(null, null);
                }
            };

            backViewController.BackClicked += (s, e) => {
                UIView.Transition(backViewController.View, transitionViewController.View, 0.75,
                                  transitionViewController.SelectedTransition, null);
            };
        }
Exemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this._toolbar = new UIToolbar(new RectangleF(0, 0, this.View.Frame.Width, 44));
            this.View.Add(this._toolbar);

            RectangleF mainFrame = new RectangleF(0, this._toolbar.Frame.Height, this.View.Frame.Width, this.View.Frame.Height - this._toolbar.Frame.Height);

            this._controller1            = new TransitionViewController();
            this._controller1.View.Frame = mainFrame;
            this._controller2            = new BackTransitionViewController();
            this._controller2.View.Frame = mainFrame;

            //this.View.AddSubview(this._controller2.View);
            this.View.AddSubview(this._controller1.View);

            //this._controller2.View.Hidden = true;

            this._controller1.TransitionClicked += (s, e) => {
                UIView.Animate(1, 0, this._controller1.SelectedTransition, () => {
                    this._controller1.View.RemoveFromSuperview();
                    this.View.AddSubview(this._controller2.View);
                    //this._controller1.View.Hidden = false;
                    //this._controller2.View.Hidden = true;
                }, null);
                UIView.BeginAnimations("ViewChange");
//				UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromLeft, this.View, true);
//				{
//					this._controller1.View.RemoveFromSuperview();
//					this.View.AddSubview(this._controller2.View);
//				}
//				UIView.CommitAnimations();
            };

            this._controller2.BackClicked += (s, e) => {
                UIView.Animate(.75, 0, this._controller1.SelectedTransition, () => {
                    this._controller2.View.RemoveFromSuperview();
                    this.View.AddSubview(this._controller1.View);
                }, null);
            };
        }
Exemplo n.º 4
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			toolbar = new UIToolbar (new RectangleF (0, 0, this.View.Frame.Width, 44));
			this.View.Add (toolbar);
			
			RectangleF mainFrame = new RectangleF (0, toolbar.Frame.Height, this.View.Frame.Width, this.View.Frame.Height - toolbar.Frame.Height);
			
			controller1 = new TransitionViewController ();
			controller1.View.Frame = mainFrame;
			controller2 = new BackTransitionViewController ();
			controller2.View.Frame = mainFrame;
			
			View.AddSubview (controller1.View);
			
			// controller2.View.Hidden = true;
			
			 controller1.TransitionClicked += (s, e) => {
				UIView.Animate (1, 0,  controller1.SelectedTransition, () => {
					controller1.View.RemoveFromSuperview ();
					View.AddSubview (controller2.View);
					// controller1.View.Hidden = false;
					// controller2.View.Hidden = true;
				}, null);
				UIView.BeginAnimations("ViewChange");
//				UIView.SetAnimationTransition(UIViewAnimationTransition.FlipFromLeft, this.View, true);
//				{
//					 controller1.View.RemoveFromSuperview();
//					this.View.AddSubview( controller2.View);
//				}
//				UIView.CommitAnimations();

			};
			
			 controller2.BackClicked += (s, e) => {
				UIView.Animate(.75, 0,  controller1.SelectedTransition, () => {
					controller2.View.RemoveFromSuperview ();
					View.AddSubview (controller1.View);
				}, null);
			};
		}