menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class MindMapTreeLayout - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class MindMapTreeLayout

    Represents a class to arrange the nodes and connectors automatically in a mind-map tree structure.

    Inheritance
    System.Object
    LayoutBase
    TreeLayoutBase
    MindMapTreeLayout
    Implements
    ILayout
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    LayoutBase.Bounds
    LayoutBase.HorizontalAlignment
    LayoutBase.Margin
    LayoutBase.VerticalAlignment
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    TreeLayoutBase.HorizontalSpacing
    TreeLayoutBase.PropertyChanged
    TreeLayoutBase.SpaceBetweenSubTrees
    TreeLayoutBase.VerticalSpacing
    Namespace: Syncfusion.UI.Xaml.Diagram.Layout
    Assembly: Syncfusion.SfDiagram.WPF.dll
    Syntax
    public class MindMapTreeLayout : TreeLayoutBase, ILayout, IInternalLayout, INotifyPropertyChanged
    Examples

    Below example shows how to create MindMapTreeLayout

    • Model.cs
    • MainWindow.xaml
    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()

    Initializes the new instance of the MindMapTreeLayout class.

    Declaration
    public MindMapTreeLayout()

    Properties

    LayoutRoot

    Gets or sets the root node of the layout.

    Declaration
    public override object LayoutRoot { get; set; }
    Property Value
    Type
    System.Object
    Overrides
    TreeLayoutBase.LayoutRoot

    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

    • ViewModel.cs
    • MainWindow.xaml
     
    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
    Type
    MindMapTreeMode
    Examples

    Below example shows how to arrange the mind map branches for MindMapTreeLayout

    • ViewModel.cs
    • MainWindow.xaml
     
    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
    Type Description
    RootChildDirection

    Specifies the direction for the branches

    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
    LayoutBase.InvalidateLayout()

    OnPropertyChanged(String)

    Method to notify when property values are changed for MindMapTreeLayout class.

    Declaration
    protected override void OnPropertyChanged(string name)
    Parameters
    Type Name Description
    System.String name
    Overrides
    TreeLayoutBase.OnPropertyChanged(String)

    UpdateLayout()

    Method to update the currently arranged Nodes and Connectors.

    Declaration
    public override void UpdateLayout()
    Overrides
    LayoutBase.UpdateLayout()

    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
    LayoutBase.UpdateLayout(Object)

    Implements

    ILayout
    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved