Skip to content

TreeView

Javier Suárez edited this page Aug 16, 2020 · 4 revisions

TreeView

The TreeView displays data in a hierarchical structure with expanding and collapsing nodes.

Features

  • Support for selection.
  • Can customize the text font properties, etc.
  • Customize the selected item.
  • ControlTemplate support.

Using the control

<controls:TreeView
    SelectionMode="Single">
    <controls:TreeView.RootNodes>     
        <controls:TreeViewNode
            Icon="folder.png"
            Text="Controls"
            IsExpanded="True">
            <controls:TreeViewNode.Children>
                <controls:TreeViewNode
                    Icon="file.png"
                    IconSelected="whitefile.png"
                    Text="AvatarView"/>
                <controls:TreeViewNode
                    Icon="folder.png"
                    Text="DataVisualization"
                    BackgroundColorSelected="DarkBlue">
                    <controls:TreeViewNode.Children>
                        <controls:TreeViewNode
                            Icon="file.png"
                            IconSelected="whitefile.png"
                            Text="Area Chart"/>
                        <controls:TreeViewNode
                            Icon="file.png"
                            IconSelected="whitefile.png"
                            Text="Bar Chart"/>
                        <controls:TreeViewNode
                            Icon="file.png"
                            IconSelected="whitefile.png"
                            Text="Line Chart"/>
                    </controls:TreeViewNode.Children>
                </controls:TreeViewNode>
            </controls:TreeViewNode.Children>
        </controls:TreeViewNode>
    </controls:TreeView.RootNodes>
</controls:TreeView>
Clone this wiki locally