Exemple #1
0
        /// <summary>
        /// Creates a ViewModel of the desired type (as well as the  ppropriate View) and inserts it into
        /// the correct Panel Container and inserts the panel container into the provided sliding panel
        /// view controller
        /// </summary>
        /// <param name="panelType">Panel type.</param>
        /// <param name="navigationViewController"></param>
        /// <param name="viewToAdd">Mvx controller.</param>
        protected void AddPanel(PanelType panelType, SlidingPanelsNavigationViewController navigationViewController, UIViewController viewToAdd)
        {
            // use the first view to create a view of the desired type
            // We only do this because there's no convenient way to create a view from inside the presenter

            // Insert the view into a new container (of the right type) and insert
            // that into the sliding panels controller
            switch (panelType)
            {
            case PanelType.LeftPanel:
                navigationViewController.InsertPanel(new LeftPanelContainer(viewToAdd));
                break;

            case PanelType.RightPanel:
                navigationViewController.InsertPanel(new RightPanelContainer(viewToAdd));
                break;

            case PanelType.BottomPanel:
                navigationViewController.InsertPanel(new BottomPanelContainer(viewToAdd));
                break;

            default:
                throw new ArgumentException("PanelType is invalid");
            }
        }
Exemple #2
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            SlidingPanelsNavigationViewController navController = new SlidingPanelsNavigationViewController(new ExampleContentA());

            UIViewController rootController = new UIViewController();

            rootController.AddChildViewController(navController);
            rootController.View.AddSubview(navController.View);

            window.RootViewController = rootController;
            window.MakeKeyAndVisible();

            navController.InsertPanel(new LeftPanelContainer(new LeftPanelViewController(navController)));
            navController.InsertPanel(new RightPanelContainer(new RightPanelViewController(navController)));
            navController.InsertPanel(new BottomPanelContainer(new BottomPanelViewController(navController)));

            return(true);
        }
Exemple #3
0
        protected override void ShowFirstView(UIViewController viewController)
        {
            base.ShowFirstView(viewController);

            _slidingPanelsController = (SlidingPanelsNavigationViewController)MasterNavigationController;

            _rootViewController.AddChildViewController(_slidingPanelsController);
            _rootViewController.View.AddSubview(_slidingPanelsController.View);

            var menuRequest = new MvxViewModelRequest <MenuViewModel>(new MvxBundle(null), null, MvxRequestedBy.UserAction);
            var menuView    = (UIViewController)ViewCreator.CreateView(menuRequest);

            _menuPanelContainer = new LeftPanelContainer(menuView)
            {
                EdgeTolerance = 100f
            };
            _slidingPanelsController.InsertPanel(_menuPanelContainer);
        }