Class DirectedTreeLayout
Represents a class to arrange the nodes and connectors automatically in a tree structure.
Inherited Members
Namespace: Syncfusion.UI.Xaml.Diagram.Layout
Assembly: Syncfusion.SfDiagram.WPF.dll
Syntax
public class DirectedTreeLayout : TreeLayoutBase, ILayout, IInternalLayout, INotifyPropertyChanged
Examples
Below code shows how to create Hierarchical tree layout
public class Employee
{
public string Name { get; set; }
public string EmpId { get; set; }
public string ParentId { get; set; }
public string Designation { get; set; }
}
public class Employees : ObservableCollection<Employee>
{
}
Constructors
DirectedTreeLayout()
Initializes the new instance of the DirectedTreeLayout class.
Declaration
public DirectedTreeLayout()
Properties
AvoidSegmentOverlapping
Gets or sets a value indicating whether segment of each connector from a single parent is distributed automatically or not.
Declaration
public bool AvoidSegmentOverlapping { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
This property is applicable only for hierarchical and multi-parent layout.
LayoutRoot
Gets or sets the root node of the layout.
Declaration
public override object LayoutRoot { get; set; }
Property Value
Type |
---|
System.Object |
Overrides
Orientation
Gets or sets a value that indicates the dimension by which child elements are layouted in the directed tree.
Declaration
public TreeOrientation Orientation { get; set; }
Property Value
Type |
---|
TreeOrientation |
Type
Gets or sets the type (Organization / Hierarchical) of the layout.
Declaration
public LayoutType Type { get; set; }
Property Value
Type |
---|
LayoutType |
Methods
ArrangeChildren(Object, IEnumerable<INode>)
Determine the order of Node's neighbor, during automatic layout.
Declaration
protected virtual IEnumerable<INode> ArrangeChildren(object parent, IEnumerable<INode> children)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | |
System.Collections.Generic.IEnumerable<INode> | children |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<INode> | Return Nodes as children for the respective parent |
GetFirstChild(INode)
To get the first child for the parent.
Declaration
protected virtual INodeInfo GetFirstChild(INode parent)
Parameters
Type | Name | Description |
---|---|---|
INode | parent |
Returns
Type | Description |
---|---|
INodeInfo | Returns FirstChild of the parent. |
GetLastChild(INode)
To get the last child for the parent.
Declaration
protected virtual INodeInfo GetLastChild(INode parent)
Parameters
Type | Name | Description |
---|---|---|
INode | parent |
Returns
Type | Description |
---|---|
INodeInfo | Returns the LastChild of the parent. |
GetNextSibling(INode)
To get the next sibling of the child.
Declaration
protected virtual INodeInfo GetNextSibling(INode child)
Parameters
Type | Name | Description |
---|---|---|
INode | child |
Returns
Type | Description |
---|---|
INodeInfo | Returns the next sibling of the child. |
GetPreviousSibling(INode)
To get the previous sibling of the child.
Declaration
protected virtual INodeInfo GetPreviousSibling(INode child)
Parameters
Type | Name | Description |
---|---|---|
INode | child |
Returns
Type | Description |
---|---|
INodeInfo | Returns the PreviousSibling of the child. |
InvalidateLayout()
Invalidates the arrange state (layout) for the element. After the invalidation, the element will have its layout updated, which will occur asynchronously unless subsequently forced by UpdateLayout().
Declaration
public override void InvalidateLayout()
Overrides
OnPropertyChanged(String)
Invokes when a property value changes.
Declaration
protected override void OnPropertyChanged(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The Name of the property. |
Overrides
UpdateLayout()
Method to update the currently arranged Nodes and Connectors.
Declaration
public override void UpdateLayout()
Overrides
UpdateLayout(Object)
Method to update the currently arranged Nodes and Connectors.
Declaration
public override void UpdateLayout(object fixedNode)
Parameters
Type | Name | Description |
---|---|---|
System.Object | fixedNode | The node which is used as anchor to layout |