Class TreeViewItem
A tree view item that can be used directly in a ScrollView or any vertical container.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class TreeViewItem : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Constructors
TreeViewItem()
Initializes a new instance of the TreeViewItem class.
Declaration
public TreeViewItem()
Fields
caretButtonUssClassName
The USS class name for the caret button of the TreeViewItem.
Declaration
public const string caretButtonUssClassName = "appui-tree-view-item__caret-button"
Field Value
Type | Description |
---|---|
string |
caretIconUssClassName
The USS class name for the caret icon of the TreeViewItem.
Declaration
public const string caretIconUssClassName = "appui-tree-view-item__caret-icon"
Field Value
Type | Description |
---|---|
string |
contentContainerUssClassName
The USS class name for the content container of the TreeViewItem.
Declaration
public const string contentContainerUssClassName = "appui-tree-view-item__content-container"
Field Value
Type | Description |
---|---|
string |
contentViewportUssClassName
The USS class name for the content viewport of the TreeViewItem.
Declaration
public const string contentViewportUssClassName = "appui-tree-view-item__content-viewport"
Field Value
Type | Description |
---|---|
string |
depthVariantUssClassName
The USS class name for the TreeViewItem based on its depth.
Declaration
public const string depthVariantUssClassName = "appui-tree-view-item--depth-"
Field Value
Type | Description |
---|---|
string |
expandedVariantUssClassName
The USS class name for the TreeViewItem when it is expanded.
Declaration
public const string expandedVariantUssClassName = "appui-tree-view-item--expanded"
Field Value
Type | Description |
---|---|
string |
headerUssClassName
The USS class name for the header of the TreeViewItem.
Declaration
public const string headerUssClassName = "appui-tree-view-item__header"
Field Value
Type | Description |
---|---|
string |
interactableVariantUssClassName
The USS class name for the TreeViewItem when it is interactable (has a clickable header).
Declaration
public const string interactableVariantUssClassName = "appui-tree-view-item--interactable"
Field Value
Type | Description |
---|---|
string |
selectedVariantUssClassName
The USS class name for the TreeViewItem when it is selected.
Declaration
public const string selectedVariantUssClassName = "appui-tree-view-item--selected"
Field Value
Type | Description |
---|---|
string |
titleLabelUssClassName
The USS class name for the title label of the TreeViewItem.
Declaration
public const string titleLabelUssClassName = "appui-tree-view-item__title-label"
Field Value
Type | Description |
---|---|
string |
ussClassName
The USS class name for the TreeViewItem.
Declaration
public const string ussClassName = "appui-tree-view-item"
Field Value
Type | Description |
---|---|
string |
withCaretVariantUssClassName
The USS class name for the TreeViewItem when it has a caret.
Declaration
public const string withCaretVariantUssClassName = "appui-tree-view-item--with-caret"
Field Value
Type | Description |
---|---|
string |
Properties
caretClickable
Gets or sets the clickable behavior for the caret button of the TreeViewItem.
Declaration
public Pressable caretClickable { get; set; }
Property Value
Type | Description |
---|---|
Pressable |
clickable
Gets or sets the clickable behavior for the header of the TreeViewItem.
Declaration
public Pressable clickable { get; set; }
Property Value
Type | Description |
---|---|
Pressable |
contentContainer
Child elements are added to it, usually this is the same as the element itself.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
depth
Gets or sets the depth of the TreeViewItem in the tree view hierarchy. This is used to determine the indentation level of the item.
Declaration
public int depth { get; set; }
Property Value
Type | Description |
---|---|
int |
expanded
Gets or sets whether the TreeViewItem is expanded or collapsed.
Declaration
public bool expanded { get; set; }
Property Value
Type | Description |
---|---|
bool |
label
Gets or sets the label of the TreeViewItem.
Declaration
public string label { get; set; }
Property Value
Type | Description |
---|---|
string |
selected
Gets or sets whether the TreeViewItem is in selected state.
Declaration
public bool selected { get; set; }
Property Value
Type | Description |
---|---|
bool |
showCaret
Gets or sets whether the caret is shown for this TreeViewItem.
Declaration
public bool showCaret { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
ToggleExpand()
Toggles the expanded state of the TreeViewItem.
Declaration
public void ToggleExpand()