This sample allows a user to make progressive decisions about personality types.

There are two kinds of nodes, so there are two DataTemplates ("DecisionNode" and "PersonalityNode") for nodes.

The "DecisionNode" template displays the abbreviated personality type and two choice buttons, all surrounded by a figure. Clicking a button will either expand the choice or will collapse all nodes leading from that choice. All of these changes are performed within a model transaction, by calling Diagram.StartTransaction and Diagram.CommitTransaction. Committing the transaction will also perform a TreeLayout, because changing the visibility of nodes and links will invalidate the existing layout.

The "PersonalityNode" template displays the personality descriptions, as the "leaf" nodes for the tree.