menu

UWP

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

    Show / Hide Table of Contents

    Class LayoutManager

    Represents a class which manages the node and connector arrangement.

    Inheritance
    System.Object
    LayoutManager
    Namespace: Syncfusion.UI.Xaml.Diagram.Layout
    Assembly: Syncfusion.SfDiagram.UWP.dll
    Syntax
    public class LayoutManager : Object
    Examples

    Below code shows how to create DirectedTreeLayout using LayoutManager

    • Model.cs
    • MainWindow.xaml
    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>
    {
    }
    <!-- Initializes the employee collection-->
    <local:Employees x:Key="employees">
        <local:Employee Name = "Steve" EmpId="1" ParentId="" Designation="CEO"/>
        <local:Employee Name = "Kevin" EmpId="2" ParentId="1" Designation="Manager"/>
        <local:Employee Name = "John" EmpId="3" ParentId="1" Designation="Manager"/>
        <local:Employee Name = "Raj" EmpId="4" ParentId="2" Designation="Team Lead"/>
        <local:Employee Name = "Will" EmpId="5" ParentId="2" Designation="S/w Developer"/>
        <local:Employee Name = "Sarah" EmpId="6" ParentId="3" Designation="TeamLead"/>
        <local:Employee Name = "Mike" EmpId="7" ParentId="3" Designation="Testing Engineer"/>
    </local:Employees>    
    <!--Initializes the DataSourceSettings -->
    <Syncfusion:DataSourceSettings x:Key="dataSourceSettings" Id="EmpId"                               
     ParentId="ParentId" DataSource="{StaticResource employees}" />     
    <!--Initialize the Layout-->
    <Syncfusion:DirectedTreeLayout x:Name="DirectedTreeLayout"                               
                                   x:Key="treeLayout"                                
                                   HorizontalSpacing="30" 
                                   VerticalSpacing="50" 
                                   Orientation="TopToBottom" 
                                   Type="Hierarchical" 
                                   SpaceBetweenSubTrees="20" />
    <!--Initialize the Layout Manager-->
    <Syncfusion:LayoutManager x:Key="layoutManager" 
                         Layout="{StaticResource treeLayout}"/> 
    <!--Initializes the SfDiagram --> 
    <Syncfusion:SfDiagram x:Name="diagram" Grid.Column="0" 
                         LayoutManager="{StaticResource layoutManager}" 
                        DataSourceSettings="{StaticResource dataSourceSettings}">   
    </Syncfusion:SfDiagram>                      

    Constructors

    LayoutManager()

    Declaration
    public LayoutManager()

    Properties

    Layout

    Gets or sets the type of layout either directed tree or radial tree.

    Declaration
    public LayoutBase Layout { get; set; }
    Property Value
    Type
    LayoutBase

    RefreshFrequency

    Gets or sets the value when to update the current layout.

    Declaration
    public RefreshFrequency RefreshFrequency { get; set; }
    Property Value
    Type
    RefreshFrequency

    Methods

    OnLayoutChanged(LayoutBase, LayoutBase)

    Method to set the graph value when layoutbase value gets changed.

    Declaration
    protected virtual void OnLayoutChanged(LayoutBase oldValue, LayoutBase newValue)
    Parameters
    Type Name Description
    LayoutBase oldValue
    LayoutBase newValue

    Extension Methods

    DateTimeExtension.ToDateTime(Object)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved