예제 #1
0
        public ShellNavBar(IFlyoutController flyoutController) : base(System.Maui.Maui.NativeParent)
        {
            _flyoutController = flyoutController;

            _menuButton          = new EButton(System.Maui.Maui.NativeParent);
            _menuButton.Clicked += OnMenuClicked;
            _menu = new EImage(System.Maui.Maui.NativeParent);
            UpdateMenuIcon();
            _menu.Show();
            _menuButton.Show();

            _menuButton.SetPartContent("icon", _menu);

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

            BackgroundColor             = _backgroudColor;
            _menuButton.BackgroundColor = _backgroudColor;
            PackEnd(_menuButton);
            PackEnd(_title);
            LayoutUpdated += OnLayoutUpdated;
        }
        public ShellSectionNavigation(IFlyoutController flyoutController, ShellSection section) : base(Forms.NativeParent)
        {
            _section = section;
            _section.PropertyChanged += OnSectionPropertyChanged;
            _rootPage = ((IShellContentController)_section.CurrentItem).GetOrCreateContent();

            _navBar = new ShellNavBar(flyoutController, this);
            _navBar.Show();

            var renderer = CreateShellSection(section);

            renderer.Control.Show();
            _navigationStack.AddLast(renderer.Control);
            _pageToNative[_rootPage]        = renderer.Control;
            _nativeToPage[renderer.Control] = _rootPage;

            IShellSectionController controller = _section as IShellSectionController;

            controller.NavigationRequested += OnNavigationRequested;
            controller.AddDisplayedPageObserver(this, UpdateDisplayedPage);

            PackEnd(_navBar);
            PackEnd(renderer.Control);
            LayoutUpdated += OnLayoutUpdated;
            ((IShellController)_section.Parent.Parent).AddAppearanceObserver(this, _section);
        }
예제 #3
0
        public ShellItemRenderer(IFlyoutController flyoutController, ShellItem item)
        {
            _flyoutController           = flyoutController;
            _shellItem                  = item;
            _shellItem.PropertyChanged += OnShellItemPropertyChanged;
            (_shellItem.Items as INotifyCollectionChanged).CollectionChanged += OnShellItemsCollectionChanged;

            _box = new Native.Box(Forms.NativeParent);
            _box.LayoutUpdated += OnLayoutUpdated;
            _box.Show();

            CreateToolbar();
            CreateMoreToolbar();
            ResetToolbarItems();

            UpdateCurrentShellSection(_shellItem.CurrentItem);
            if (_drawer != null)
            {
                _currentSection?.StackBelow(_drawer);
            }

            ((IShellController)_shellItem.Parent).AddAppearanceObserver(this, _shellItem);
        }
예제 #4
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;
        }
예제 #5
0
        public ShellItemRenderer(IFlyoutController flyoutController, ShellItem item)
        {
            _flyoutController           = flyoutController;
            _shellItem                  = item;
            _shellItem.PropertyChanged += OnShellItemPropertyChanged;
            (_shellItem.Items as INotifyCollectionChanged).CollectionChanged += OnShellItemsCollectionChanged;

            _box = new Native.Box(System.Maui.Maui.NativeParent);
            _box.LayoutUpdated += OnLayoutUpdated;
            _box.Show();

            // Create Tabs
            _tabs = CreateTabs();
            _tabs.TargetView.Show();
            Control.PackEnd(_tabs as EvasObject);
            InitializeTabs();

            // Create More Tabs
            _more = CreateMoreToolbar();
            _more.Show();

            _drawer = CreateDrawer();
            _drawer.Show();
            Control.PackEnd(_drawer);
            InitialzeDrawer(_more);

            ResetToolbarItems();

            UpdateCurrentShellSection(_shellItem.CurrentItem);
            if (_drawer != null)
            {
                _currentSection?.StackBelow(_drawer);
            }

            ((IShellController)_shellItem.Parent).AddAppearanceObserver(this, _shellItem);
        }
예제 #6
0
 protected virtual ShellSectionNavigation CreateShellSectionNavigation(IFlyoutController flyoutController, ShellSection section)
 {
     return(new ShellSectionNavigation(flyoutController, section));
 }
 public MaterialShellSectionNavigation(IFlyoutController flyoutController, ShellSection section) : base(flyoutController, section)
 {
 }
예제 #8
0
 public MaterialShellItemRenderer(IFlyoutController flyoutController, ShellItem item) : base(flyoutController, item)
 {
 }
예제 #9
0
 protected override ShellSectionNavigation CreateShellSectionNavigation(IFlyoutController flyoutController, ShellSection section)
 {
     return(new MaterialShellSectionNavigation(flyoutController, section));
 }