Ejemplo n.º 1
0
        //public override void DidReceiveMemoryWarning()
        //{
        //    base.DidReceiveMemoryWarning();
        //    // Release any cached data, images, etc that aren't in use.
        //}

        #endregion

        #region NavigationBar

        private static void OnAlertMessage(AlertMessage alert)
        {
            AlertItem.SetVisibility(alert.Type, alert.Visible);
            ContainerPresenter.NavigationController.NavigationBar.TopItem.SetRightBarButtonItems(AlertItem.GetAlertItems(), false);
        }
Ejemplo n.º 2
0
        public override void Show(MvxViewModelRequest request)
        {
            if (NavigationController == null)
            {
                // First controller called from main hamburger menu.  Must have decorator: WrapInNavigationController = true
                base.Show(request);
            }
            else
            {
                // Subsequent controllers called from main menu or other views
                MvxViewController c   = _rootController.CreateViewControllerFor(request) as MvxViewController;
                string            val = "";
                if (request.PresentationValues != null)
                {
                    request.PresentationValues.TryGetValue("NavigationMode", out val);
                }
                if (val.Equals("Push", StringComparison.Ordinal))
                {
                    // Push new controller onto navigation stack
                    PushViewControllerIntoStack(NavigationController, c, true);
                }
                else
                {
                    // Replace stack in existing navigation controller with new controller
                    UIViewController[] controllers = { c };

                    // SetViewControllers unloads all the navigation bar buttons
                    // Don't animate to avoid visible refresh when switching root menu items
                    NavigationController.SetViewControllers(controllers, false);
                    NavigationController.NavigationBar.TopItem.SetRightBarButtonItems(AlertItem.GetAlertItems(), false);
                    NavigationController.NavigationBar.TopItem.SetLeftBarButtonItem(HamburgerItem.Button, false);
                }
            }
        }