示例#1
0
        public UISideMenuNavigationController(SideMenuManager sideMenuManager, UIViewController rootViewController, bool leftSide = true) : base(rootViewController)
        {
            SideMenuManager = sideMenuManager;

            LeftSide = leftSide;
            SideMenuManager.LeftNavigationController = this;
        }
示例#2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                SideMenuManager = null;
            }

            base.Dispose(disposing);
        }
示例#3
0
 public SideMenuTransition(SideMenuManager sideMenuManager)
 {
     SideMenuManager = sideMenuManager;
 }
示例#4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(
                                                         UIImage.FromFile("menu.png"),
                                                         UIBarButtonItemStyle.Plain,
                                                         (s, e) =>
            {
                PresentViewController(_sideMenuManager.LeftNavigationController, true, null);
            }
                                                         ),
                                                     false);

            _sideMenuManager = new SideMenuManager();

            View.BackgroundColor = UIColor.White;
            Title = "Side Menu";

            var menuPresentMode = new UILabel
            {
                Text = "Menu Present Mode",
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            this.View.Add(menuPresentMode);

            var menuScreenWidth = new UILabel
            {
                Text = "Menu Screen Width",
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            this.View.Add(menuScreenWidth);

            _menuScreenWidth = new UISlider
            {
                MinValue   = 0f,
                MaxValue   = 1f,
                Value      = .75f,
                Continuous = true,
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            _menuScreenWidth.ValueChanged += (sender, e) =>
            {
                _sideMenuManager.MenuWidth = this.View.Frame.Width * _menuScreenWidth.Value;
            };
            this.View.Add(_menuScreenWidth);

            var menuTransformScaleFactor = new UILabel
            {
                Text = "Menu Transform Scale Factor",
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            this.View.Add(menuTransformScaleFactor);

            _menuTransformScaleFactor = new UISlider
            {
                MinValue   = 0f,
                MaxValue   = 2f,
                Value      = 1f,
                Continuous = true,
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            _menuTransformScaleFactor.ValueChanged += (sender, e) =>
            {
                _sideMenuManager.AnimationTransformScaleFactor = _menuTransformScaleFactor.Value;
            };
            this.View.Add(_menuTransformScaleFactor);

            SetupSideMenu();
        }