Пример #1
0
        public static void Scan(ScanLayer scanLayer)
        {
            ScanController controller    = new ScanController(scanLayer);
            var            navController = new PopoverNavigationController(controller)
            {
                ModalPresentationStyle = UIModalPresentationStyle.FormSheet
            };

            navController.SetCloseButton(controller);

            if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
            {
                if (!TouchFactory.TheApp.Style.HeaderColor.IsDefaultColor)
                {
                    navController.NavigationBar.BarTintColor = TouchFactory.TheApp.Style.HeaderColor.ToUIColor();
                }

                if (!TouchFactory.TheApp.Style.HeaderTextColor.IsDefaultColor)
                {
                    navController.NavigationBar.TintColor           = TouchFactory.TheApp.Style.HeaderTextColor.ToUIColor();
                    navController.NavigationBar.TitleTextAttributes = new UIStringAttributes()
                    {
                        ForegroundColor = TouchFactory.TheApp.Style.HeaderTextColor.ToUIColor()
                    };
                }
            }
            else
            {
                navController.NavigationBar.TintColor = TouchFactory.TheApp.Style.HeaderColor.ToUIColor();
            }

            ModalManager.EnqueueModalTransition(TouchFactory.Instance.TopViewController, navController, true);
        }
Пример #2
0
        public static void Scan(CameraScanLayer scanLayer)
        {
            var callback = scanLayer.Callback;
            var ctrl     = new CameraScanController(scanLayer, callback, ScanLayer.BarcodeKey)
            {
                ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal
            };
            var navCtrl = new PopoverNavigationController(ctrl);

            navCtrl.SetCloseButton(ctrl);

            if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
            {
                if (!TouchFactory.TheApp.Style.HeaderColor.IsDefaultColor)
                {
                    navCtrl.NavigationBar.BarTintColor = scanLayer.LayerStyle.HeaderColor.ToUIColor();
                }

                if (!TouchFactory.TheApp.Style.HeaderTextColor.IsDefaultColor)
                {
                    navCtrl.NavigationBar.TintColor           = scanLayer.LayerStyle.HeaderTextColor.ToUIColor();
                    navCtrl.NavigationBar.TitleTextAttributes = new UIStringAttributes()
                    {
                        ForegroundColor = scanLayer.LayerStyle.HeaderTextColor.ToUIColor()
                    };
                }
            }
            else
            {
                navCtrl.NavigationBar.TintColor = scanLayer.LayerStyle.HeaderColor.ToUIColor();
            }

            ModalManager.EnqueueModalTransition(TouchFactory.Instance.TopViewController, navCtrl, true);
        }
Пример #3
0
        public void InitializeViews()
        {
            if (topViewController != null)
            {
                return;
            }

            UIViewController master = topViewController = PaneManager.Instance.FromNavContext(Pane.Master, 0) as UIViewController;

            if (master == null)
            {
                master = topViewController = new NavigationController("0");
                PaneManager.Instance.AddStack((IHistoryStack)master, new iApp.AppNavigationContext()
                {
                    ActivePane = Pane.Master
                });
            }

            var popover = new PopoverNavigationController();

            popover.PushViewController(new VanityView(), false);

            PaneManager.Instance.AddStack(popover, new iApp.AppNavigationContext()
            {
                ActivePane = Pane.Popover
            });

            if (LargeFormFactor && PaneManager.IsSplitView)
            {
                topViewController = SplitViewController = new MGSplitViewController();

                // create nav controller for detail pane
                var detail = new NavigationController("Detail");
                if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0))
                {
                    detail.NavigationBar.TintColor = UIColor.Black;
                }

                PaneManager.Instance.AddStack(detail, new iApp.AppNavigationContext()
                {
                    ActivePane = Pane.Detail
                });

                // setup the tab or nav view controller for Master Pane
                SplitViewController.SetViewControllers(new UIViewController[]
                {
                    master, detail, popover
                });
            }

            SetRoot(topViewController);
        }