Exemplo n.º 1
0
        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);

            conformant.Show();
            square = window.GetInnerSquare();

            Naviframe navi = new Naviframe(window)
            {
                PreserveContentOnPop     = true,
                DefaultBackButtonEnabled = true
            };

            _navi = navi;

            navi.Popped += (s, e) =>
            {
                Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content);
            };

            NaviItem item = navi.Push(CreatePage(window), "0 Page");

            item.SetPartContent("title_left_btn", new Button(window)
            {
                Text = "LEFT", Style = "naviframe/title_left"
            });
            item.SetPartContent("title_right_btn", new Button(window)
            {
                Text = "RIGHT", Style = "naviframe/title_right"
            });
            navi.Show();
            conformant.SetContent(navi);
        }
 void UpdateBreadCrumbsBar(NaviItem item)
 {
     if (Element.OnThisPlatform().HasBreadCrumbsBar())
     {
         item.Style = StyleNavigationBar;
         item.SetPartContent(PartNavigationBar, GetBreadCrumbsBar());
     }
     else
     {
         item.SetPartContent(PartNavigationBar, null, false);
     }
 }
        void UpdateToolbarItem(Page page, NaviItem item = null)
        {
            if (item == null)
            {
                item = GetNaviItemForPage(page);
            }

            if (_naviFrame.NavigationStack.Count == 0 || item == null || item != _naviFrame.NavigationStack.Last())
            {
                return;
            }

            Native.Button rightButton = GetToolbarButton(ToolbarButtonPosition.Right);
            item.SetPartContent(PartRightToolbar, rightButton);

            Native.Button leftButton = GetToolbarButton(ToolbarButtonPosition.Left);
            item.SetPartContent(PartLeftToolbar, leftButton);
            UpdateHasBackButton(page, item);
        }
        void UpdateHasBackButton(Page page, NaviItem item = null)
        {
            if (item == null)
            {
                item = GetNaviItemForPage(page);
            }

            EButton button = null;

            if ((bool)page.GetValue(NavigationPage.HasBackButtonProperty) && _naviFrame.NavigationStack.Count > 1)
            {
                button = CreateNavigationButton((string)page.GetValue(NavigationPage.BackButtonTitleProperty));
            }
            item.SetPartContent(PartBackButton, button);
        }
Exemplo n.º 5
0
 public static void SetNavigationBar(this NaviItem item, EvasObject content, bool preserveOldContent = false)
 {
     item.SetPartContent(ThemeConstants.NaviItem.Parts.NavigationBar, content, preserveOldContent);
 }
Exemplo n.º 6
0
 public static void SetRightToolbarButton(this NaviItem item, EvasObject content, bool preserveOldContent = false)
 {
     item.SetPartContent(ThemeConstants.NaviItem.Parts.RightToolbarButton, content, preserveOldContent);
 }