コード例 #1
0
        /// <inheritdoc />
        protected override void BuildElementUI()
        {
            base.BuildElementUI();

            var header = new VisualElement {
                name = "row-header"
            };

            header.AddToClassList(headerUssClassName);

            m_CollapseButton = new CollapseButton();
            m_CollapseButton.AddToClassList(collapseButtonUssClassName);
            header.Add(m_CollapseButton);

            m_HeaderContainer = new VisualElement {
                name = "row-header-container"
            };
            m_HeaderContainer.AddToClassList(headerContainerUssClassName);
            header.Add(m_HeaderContainer);

            Add(header);

            m_PropertyViewContainer = new VisualElement {
                name = "property-view-container"
            };
            m_PropertyViewContainer.AddToClassList(propertyViewUssClassName);
            Add(m_PropertyViewContainer);

            m_CollapseButton.RegisterCallback <ChangeEvent <bool> >(OnCollapseButtonChange);
        }
 /// <inheritdoc />
 protected override void BuildPartUI(VisualElement container)
 {
     if (m_Model is ICollapsible)
     {
         CollapseButton = new CollapseButton {
             name = PartName
         };
         CollapseButton.AddToClassList(m_ParentClassName.WithUssElement(PartName));
         container.Add(CollapseButton);
     }
 }