Ejemplo n.º 1
0
        protected virtual ValueTask <bool> ShowPageViewController(
            UIViewController viewController,
            MvxPagePresentationAttribute?attribute,
            MvxViewModelRequest request)
        {
            if (PageViewController == null)
            {
                throw new MvxException("Trying to show a page without a PageViewController, this is not possible!");
            }

            /*if (viewController is IMvxTabBarItemViewController tabBarItem)
             * {
             *  attribute.TabName = tabBarItem.TabName;
             *  attribute.TabIconName = tabBarItem.TabIconName;
             *  attribute.TabSelectedIconName = tabBarItem.TabSelectedIconName;
             * }*/

            if (attribute.WrapInNavigationController)
            {
                viewController = CreateNavigationController(viewController);
            }

            PageViewController.AddPage(
                viewController,
                attribute);
            return(new ValueTask <bool>(true));
        }