Using Tree

TWaver .NET Developer Guide

TWaver.Controls.Tree<> component inherited from System.Windows.Controls.TreeView, it binds with a DataBox, for presenting the hierarchy of elements in that DataBox, the element's hierarchy depends on the Parent-Child relationship.

Creating a tree

DataBox<Data> box = new DataBox<Data>();
Tree<Data> tree = new Tree<Data>(box);

Example

Let's create a tree, and append some data

DataBox<Data> box = new DataBox<Data>();

Group group = new Group();
box.Add(group);
SubNetwork subnetwork = new SubNetwork();
box.Add(subnetwork);

Node node = new Node();
node.Name = "Node1";
node.Parent = group;
node.AlarmState.IncreaseNewAlarm(AlarmSeverity.CRITICAL);
box.Add(node);
node = new Node();
node.Name = "Node2";
node.Parent = group;
box.Add(node);

node = new Node();
node.Name = "Node3";
node.Parent = subnetwork;
box.Add(node);

tree = new TWaver.Controls.Tree<Data>();
this.LayoutRoot.Children.Add(tree);
tree.DataBox = box;
tree.ExpandAll();

Running Result

Tree Presentation

Tree node with a alarm ballon

Tree with Checking Mode

Other Presents of Tree

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.