/// <summary>
 /// Initializes a new instance of the <see cref="MvxPanelPresentationAttribute"/> class.
 /// </summary>
 /// <param name="panel">The panel.</param>
 /// <param name="hintType">Type of the hint.</param>
 /// <param name="showPanel">if set to <c>true</c> [show panel].</param>
 /// <param name="behaviour">The splitview behaviour value</param>
 public MvxPanelPresentationAttribute(MvxPanelEnum panel, MvxPanelHintType hintType, bool showPanel, MvxSplitViewBehaviour behaviour = MvxSplitViewBehaviour.None)
 {
     Panel = panel;
     ShowPanel = showPanel;
     HintType = hintType;
     SplitViewBehaviour = behaviour;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="MvxSidePanelsPresenter"/> class.
        /// </summary>
        /// <param name="applicationDelegate">The application delegate.</param>
        /// <param name="window">The window.</param>
        public MvxSidePanelsPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
            : base(applicationDelegate, window)
        {
            _multiPanelController = new MvxMultiPanelController();
            _activePanel = MvxPanelEnum.Center;

            Mvx.RegisterSingleton<IMvxSideMenu>(_multiPanelController);
        }
 public void Open(MvxPanelEnum panelEnum)
 {
     if (panelEnum == MvxPanelEnum.Left)
         ShowLeftPanelAnimated(false);
     else if (panelEnum == MvxPanelEnum.Right)
         ShowRightPanelAnimated(false);
     else
         ShowCenterPanelAnimated(false);
 }
 public void Open(MvxPanelEnum panelEnum)
 {
     if (panelEnum == MvxPanelEnum.Left)
     {
         OpenMenu(LeftSidebarController);
     }
     else if (panelEnum == MvxPanelEnum.Right)
     {
         OpenMenu(RightSidebarController);
     }
 }
Beispiel #5
0
        protected virtual bool ShowPanelAndPopToRoot(MvxPanelEnum panel, UIViewController viewController)
        {
            var navigationController = (SideBarViewController as MvxSidebarViewController).NavigationController;

            if (navigationController == null)
            {
                return(false);
            }

            navigationController.PopToRootViewController(false);
            navigationController.PushViewController(viewController, false);

            return(true);
        }
 public void Open(MvxPanelEnum panelEnum)
 {
     if (panelEnum == MvxPanelEnum.Left)
     {
         ShowLeftPanelAnimated(false);
     }
     else if (panelEnum == MvxPanelEnum.Right)
     {
         ShowRightPanelAnimated(false);
     }
     else
     {
         ShowCenterPanelAnimated(false);
     }
 }
        /// <summary>
        /// Processes the active panel presentation.
        /// </summary>
        /// <param name="hint">The hint.</param>
        private void ProcessActivePanelPresentation(MvxPresentationHint hint)
        {
            var activePresentationHint = hint as MvxActivePanelPresentationHint;

            if (activePresentationHint != null)
            {
                var panelHint = activePresentationHint;

                _activePanel = panelHint.ActivePanel;

                if (panelHint.ShowPanel)
                {
                    ShowPanel(panelHint.ActivePanel);
                }
            }
        }
        /// <summary>
        /// Shows the panel.
        /// </summary>
        /// <param name="panel">The panel.</param>
        private void ShowPanel(MvxPanelEnum panel)
        {
            switch (panel)
            {
            case MvxPanelEnum.Center:
                _multiPanelController.ShowCenterPanelAnimated(true);
                break;

            case MvxPanelEnum.Left:
                _multiPanelController.ShowLeftPanelAnimated(true);
                break;

            case MvxPanelEnum.Right:
                _multiPanelController.ShowRightPanelAnimated(true);
                break;
            }
        }
Beispiel #9
0
        protected virtual bool ShowPanel(MvxPanelEnum panel, UIViewController viewController)
        {
            var navigationController = (SideBarViewController as MvxSidebarViewController).NavigationController;

            switch (panel)
            {
            case MvxPanelEnum.Left:
            case MvxPanelEnum.Right:
                break;

            case MvxPanelEnum.Center:
            default:
                navigationController?.PushViewController(viewController, true);
                break;
            }

            return(true);
        }
Beispiel #10
0
        protected virtual bool ShowPanelAndResetToRoot(MvxPanelEnum panel, UIViewController viewController)
        {
            var navigationController = (SideBarViewController as MvxSidebarViewController).NavigationController;

            if (navigationController == null)
            {
                return(false);
            }

            navigationController.ViewControllers = new[] { viewController };

            if (panel == MvxPanelEnum.Center)
            {
                viewController.ShowMenuButton(SideBarViewController as MvxSidebarViewController);
            }

            return(true);
        }
        protected virtual UIViewController ResolveSideMenu(MvxPanelEnum location)
        {
            var assembly = Assembly.GetEntryAssembly();

            var types = (from type in assembly.GetTypes()
                         from attribute in type.GetCustomAttributes <MvxSidebarPresentationAttribute>(true)
                         where attribute.Panel == location
                         select type).ToArray();

            if (types == null || types.Length == 0)
            {
                return(null);
            }

            if (types != null && types.Length > 1)
            {
                Mvx.Trace(MvxTraceLevel.Warning, $"Found more then one {location.ToString()} panel, using the first one in the array ({types[0].ToString()}).");
            }

            return(CreateInstance(types[0]) as UIViewController);
        }
Beispiel #12
0
 public MvxActivePanelPresentationHint(MvxPanelEnum activePanel, bool showPanel = true)
 {
     ActivePanel = activePanel;
     ShowPanel   = showPanel;
 }
 public MvxSidebarActivePanelPresentationHint(MvxPanelEnum panel, MvxSidebarPanelController sidebarPanelController, UIViewController viewController)
     : base(panel)
 {
     SidebarPanelController = sidebarPanelController;
     ViewController = viewController;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxPanelResetRootPresentationHint"/> class.
 /// </summary>
 /// <param name="panel">The panel.</param>
 public MvxPanelPushViewPresentationHint(MvxPanelEnum panel)
 {
     Panel = panel;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxPanelResetRootPresentationHint"/> class.
 /// </summary>
 /// <param name="panel">The panel.</param>
 public MvxPanelPushViewPresentationHint(MvxPanelEnum panel)
 {
     Panel = panel;
 }
Beispiel #16
0
 public MvxSidebarResetRootPresentationHint(MvxPanelEnum panel, MvxSidebarPanelController sidebarPanelController, UIViewController viewController)
     : base(panel)
 {
     SidebarPanelController = sidebarPanelController;
     ViewController         = viewController;
 }
Beispiel #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxPanelResetRootPresentationHint"/> class.
 /// </summary>
 /// <param name="panel">The panel.</param>
 public MvxPanelResetRootPresentationHint(MvxPanelEnum panel)
 {
     Panel = panel;
 }
 /// <summary>
 /// Shows the panel.
 /// </summary>
 /// <param name="panel">The panel.</param>
 private void ShowPanel(MvxPanelEnum panel)
 {
     switch (panel)
     {
         case MvxPanelEnum.Center:
             _multiPanelController.ShowCenterPanelAnimated(true);
             break;
         case MvxPanelEnum.Left:
             _multiPanelController.ShowLeftPanelAnimated(true);
             break;
         case MvxPanelEnum.Right:
             _multiPanelController.ShowRightPanelAnimated(true);
             break;
     }
 }
 public MvxActivePanelPresentationHint(MvxPanelEnum activePanel, bool showPanel = true)
 {
     ActivePanel = activePanel;
     ShowPanel = showPanel;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxPanelResetRootPresentationHint"/> class.
 /// </summary>
 /// <param name="panel">The panel.</param>
 public MvxPanelPopToRootPresentationHint(MvxPanelEnum panel)
 {
     Panel = panel;
 }
Beispiel #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxPanelPopToRootPresentationHint"/> class.
 /// </summary>
 /// <param name="panel">The panel.</param>
 public MvxPanelPopToRootPresentationHint(MvxPanelEnum panel)
 {
     Panel = panel;
 }
        /// <summary>
        /// Processes the active panel presentation.
        /// </summary>
        /// <param name="hint">The hint.</param>
        private void ProcessActivePanelPresentation(MvxPresentationHint hint)
        {
            var activePresentationHint = hint as MvxActivePanelPresentationHint;
            if (activePresentationHint != null)
            {
                var panelHint = activePresentationHint;

                _activePanel = panelHint.ActivePanel;

                if (panelHint.ShowPanel)
                {
                    ShowPanel(panelHint.ActivePanel);
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxPanelResetRootPresentationHint"/> class.
 /// </summary>
 /// <param name="panel">The panel.</param>
 public MvxPanelResetRootPresentationHint(MvxPanelEnum panel)
 {
     Panel = panel;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxSidePanelsPresenter"/> class.
 /// </summary>
 /// <param name="applicationDelegate">The application delegate.</param>
 /// <param name="window">The window.</param>
 public MvxSidePanelsPresenter(UIApplicationDelegate applicationDelegate, UIWindow window)
     : base(applicationDelegate, window)
 {
     _multiPanelController = new MvxMultiPanelController();
     _activePanel = MvxPanelEnum.Center;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvxSidePanelsPresenter"/> class.
 /// </summary>
 /// <param name="applicationDelegate">The application delegate.</param>
 /// <param name="window">The window.</param>
 public MvxSidePanelsPresenter(UIApplicationDelegate applicationDelegate, UIWindow window) :
     base(applicationDelegate, window)
 {
     _multiPanelController = new MvxMultiPanelController();
     _activePanel          = MvxPanelEnum.Center;
 }