Class MindMapTreeLayout
Represents a class to arrange the nodes and connectors automatically in a mind-map tree structure.
Inheritance
System.Object
MindMapTreeLayout
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Syncfusion.SfDiagram.WPF.dll
Syntax
public class MindMapTreeLayout : TreeLayoutBase, ILayout, IInternalLayout, INotifyPropertyChanged
Examples
Below example shows how to create MindMapTreeLayout
public class MindmapDataItem
{
public string Label { get; set; }
public string ParentId { get; set; }
}
public class MindmapDataItems : ObservableCollection<MindmapDataItem>
{
}
<model:MindmapDataItems x:Key="datasource">
<model:MindmapDataItem Label = "Creativity" ParentId=""></model:MindmapDataItem>
<model:MindmapDataItem Label = "Brainstorming" ParentId="Creativity"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Complementing" ParentId="Creativity"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Sessions" ParentId="Brainstorming"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Generate" ParentId="Brainstorming"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Local" ParentId="Sessions"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Remote" ParentId="Sessions"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Individual" ParentId="Sessions"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Teams" ParentId="Sessions"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Ideas" ParentId="Generate"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Engagement" ParentId="Generate"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Product" ParentId="Ideas"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Service" ParentId="Ideas"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Business Direction" ParentId="Ideas"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Empowering" ParentId="Engagement"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Ownership" ParentId="Engagement"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Information" ParentId="Complementing"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Expectations" ParentId="Complementing"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Competitors" ParentId="Information"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Products" ParentId="Information"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Features" ParentId="Information"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Other Data" ParentId="Information"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Organization" ParentId="Expectations"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Customer" ParentId="Expectations"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Staff" ParentId="Expectations"></model:MindmapDataItem>
<model:MindmapDataItem Label = "Stakeholders" ParentId="Expectations"></model:MindmapDataItem>
</model:MindmapDataItems>
<!--Initializes the DataSourceSettings -->
<Syncfusion:DataSourceSettings x:Key="dataSourceSettings" Id="Label"
ParentId="ParentId"
DataSource="{StaticResource datasource}" />
<Syncfusion:MindMapTreeLayout x:Key="Mindmaplayout"
HorizontalSpacing="50"
VerticalSpacing="30"
Orientation="Horizontal"
SplitMode="Custom" />
<!--Initialize the Layout Manager-->
<Syncfusion:LayoutManager x:Key="layoutManager"
Layout="{StaticResource Mindmaplayout}"/>
<!--Initializes the SfDiagram-->
<Syncfusion:SfDiagram x:Name="Diagram"
DataSourceSettings="{StaticResource dataSourceSettings}"
LayoutManager="{Binding layoutManager}"/>
Constructors
MindMapTreeLayout()
Declaration
public MindMapTreeLayout()
Properties
LayoutRoot
Gets or sets the root node of the layout.
Declaration
public override object LayoutRoot { get; set; }
Property Value
Overrides
Orientation
Gets or sets a value that indicates the dimension by which child elements are layouted in the mind-map tree.
Declaration
public Orientation Orientation { get; set; }
Property Value
Type |
System.Windows.Controls.Orientation |
Examples
Below example shows how the mind-map tree orientation is assigned for MindMapTreeLayout
diagram.LayoutManager = new LayoutManager()
{
Layout = new MindMapTreeLayout()
{
Orientation = Orientation.Horizontal,
},
};
This example shows how the mind-map tree orientation is assigned for MindMapTreeLayout
<!--Initializes the DataSourceSettings -->
<Syncfusion:DataSourceSettings x:Key="dataSourceSettings" Id="Label"
ParentId="ParentId"
DataSource="{StaticResource datasource}" />
<Syncfusion:MindMapTreeLayout x:Key="Mindmaplayout"
HorizontalSpacing="50"
VerticalSpacing="30"
Orientation="Horizontal"
SplitMode="Custom" />
<!--Initialize the Layout Manager-->
<Syncfusion:LayoutManager x:Key="layoutManager"
Layout="{StaticResource Mindmaplayout}"/>
<!--Initializes the SfDiagram-->
<Syncfusion:SfDiagram x:Name="Diagram"
DataSourceSettings="{StaticResource dataSourceSettings}"
LayoutManager="{Binding layoutManager}"/>
SplitMode
Gets or sets the criteria for arranging the mind map branches.
Declaration
public MindMapTreeMode SplitMode { get; set; }
Property Value
Examples
Below example shows how to arrange the mind map branches for MindMapTreeLayout
diagram.LayoutManager = new LayoutManager()
{
Layout = new MindMapTreeLayout()
{
SplitMode = MindMapTreeMode.Area,
},
};
This example shows how to arrange the mind map branches for MindMapTreeLayout
<!--Initializes the DataSourceSettings -->
<Syncfusion:DataSourceSettings x:Key="dataSourceSettings" Id="Label"
ParentId="ParentId"
DataSource="{StaticResource datasource}" />
<Syncfusion:MindMapTreeLayout x:Key="Mindmaplayout"
HorizontalSpacing="50"
VerticalSpacing="30"
Orientation="Horizontal"
SplitMode="Area" />
<!--Initialize the Layout Manager-->
<Syncfusion:LayoutManager x:Key="layoutManager"
Layout="{StaticResource Mindmaplayout}"/>
<!--Initializes the SfDiagram-->
<Syncfusion:SfDiagram x:Name="Diagram"
DataSourceSettings="{StaticResource dataSourceSettings}"
LayoutManager="{Binding layoutManager}"/>
Methods
GetRootChildDirection(INode)
When overridden in a derived class, determines the direction for sub-branches.
Declaration
protected virtual RootChildDirection GetRootChildDirection(INode node)
Parameters
Type |
Name |
Description |
INode |
node |
Instance of INode
|
Returns
Examples
Below example shows how to specify the direction for mind-map tree branches.
SfDiagram.LayoutManager = new LayoutManager()
{
Layout = new MindMapTreeLayout()
{
SplitMode = MindMapTreeMode.Custom,
},
};
public class SfMindMapTreeLayout : MindMapTreeLayout
{
protected override RootChildDirection GetRootChildDirection(INode node)
{
if (node.Content is MindmapDataItem)
{
return (node.Content as MindmapDataItem).Direction = RootChildDirection.Left; ;
}
return base.GetRootChildDirection(node);
}
}
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)
Declaration
protected override void OnPropertyChanged(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
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
|
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged