void UpdateCurrentShellSection(ShellSection section)
        {
            _currentSection?.Hide();

            if (section == null)
            {
                _currentSection = null;
                return;
            }

            ShellSectionNavigation native = null;

            if (_sectionToPage.ContainsKey(section))
            {
                native = _sectionToPage[section] as ShellSectionNavigation;
            }
            else
            {
                native = CreateShellSectionNavigation(_flyoutController, section);
                _sectionToPage[section] = native;
                Control.PackEnd(native);
            }
            _currentSection = native;
            _currentSection.Show();
            return;
        }
Exemplo n.º 2
0
        public ShellNavBar(IFlyoutController flyoutController, ShellSectionNavigation shellSectionNavigation) : base(Forms.NativeParent)
        {
            _flyoutController       = flyoutController;
            _shellSectionNavigation = shellSectionNavigation;

            _menu          = new Native.Image(Forms.NativeParent);
            _menu.Clicked += OnMenuClicked;
            UpdateMenuIcon();
            _menu.Show();

            _title = new Native.Label(Forms.NativeParent)
            {
                FontSize = Device.Idiom == TargetIdiom.TV ? 60 : 23,
                VerticalTextAlignment = Native.TextAlignment.Center,
                TextColor             = _backgroudColor,
                FontAttributes        = FontAttributes.Bold,
            };
            _title.Show();

            BackgroundColor = _backgroudColor;
            PackEnd(_menu);
            PackEnd(_title);
            LayoutUpdated += OnLayoutUpdated;
        }