コード例 #1
0
        private void InitTreeMenu()
        {
            var cellHeight = Resources.GetDimensionPixelSize(Resource.Dimension.height_category_cell);

            _treeMenu = new TreeMenuView <Category, long>(this, (_, __) => new CategoryCell(this), cellHeight);
            _layout.AddView(_treeMenu.View, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));

            _treeMenu.Items         = Category.CreateSamples();
            _treeMenu.NodeSelected += HandleSelectedNode;
        }
コード例 #2
0
        private void InitTreeMenu()
        {
            _treeMenu = new TreeMenuView <Category, long>(CategoryCell.CellIdentifier, CategoryCell.Height);
            _treeMenu.RegisterClassForCell(typeof(CategoryCell), CategoryCell.CellIdentifier);
            _treeMenu.View.TranslatesAutoresizingMaskIntoConstraints = false;
            View.AddSubview(_treeMenu.View);

            _treeMenu.View.TopAnchor.ConstraintEqualTo(View.TopAnchor).Active           = true;
            _treeMenu.View.LeadingAnchor.ConstraintEqualTo(View.LeadingAnchor).Active   = true;
            _treeMenu.View.TrailingAnchor.ConstraintEqualTo(View.TrailingAnchor).Active = true;
            _treeMenu.View.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active     = true;

            _treeMenu.Items         = Category.CreateSamples();
            _treeMenu.NodeSelected += HandleSelectedNode;
        }