Exemplo n.º 1
0
        public ShellSectionRenderer(ShellSection section)
        {
            _section = section;
            _section.PropertyChanged += OnSectionPropertyChanged;
            (_section.Items as INotifyCollectionChanged).CollectionChanged += OnShellSectionCollectionChanged;

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

            _tabs = CreateToolbar();
            _tabs.TargetView.Show();
            Control.PackEnd(_tabs as EvasObject);
            InitializeTabs();

            ResetToolbarItem();
            UpdateCurrentShellContent(_section.CurrentItem);

            ((IShellController)_section.Parent.Parent).AddAppearanceObserver(this, _section);
        }
Exemplo n.º 2
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);
        }