menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TreeMapLeafItemSettings - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TreeMapLeafItemSettings

    Represents settings for customizing the appearance of leaf items in the SfTreeMap.

    Inheritance
    System.Object
    TreeMapLeafItemSettings
    Namespace: Syncfusion.Maui.TreeMap
    Assembly: Syncfusion.Maui.TreeMap.dll
    Syntax
    public class TreeMapLeafItemSettings : BindableObject

    Constructors

    TreeMapLeafItemSettings()

    Declaration
    public TreeMapLeafItemSettings()

    Fields

    LabelPathProperty

    Identifies the LabelPath dependency property.

    Declaration
    public static readonly BindableProperty LabelPathProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for LabelPath dependency property.

    SpacingProperty

    Identifies the Spacing dependency property.

    Declaration
    public static readonly BindableProperty SpacingProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Spacing dependency property.

    StrokeProperty

    Identifies the Stroke dependency property.

    Declaration
    public static readonly BindableProperty StrokeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Stroke dependency property.

    StrokeWidthProperty

    Identifies the StrokeWidth dependency property.

    Declaration
    public static readonly BindableProperty StrokeWidthProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for StrokeWidth dependency property.

    TextFormatOptionProperty

    Identifies the TextFormatOption dependency property.

    Declaration
    public static readonly BindableProperty TextFormatOptionProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for TextFormatOption dependency property.

    TextStyleProperty

    Identifies the TextStyle dependency property.

    Declaration
    public static readonly BindableProperty TextStyleProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for TextStyle dependency property.

    Properties

    LabelPath

    Gets or sets the path of the label for the leaf items in the SfTreeMap.

    Declaration
    public string LabelPath { get; set; }
    Property Value
    Type Description
    System.String

    The default value of LabelPath is System.String.Empty.

    Remarks

    This property specifies the path of the label for the leaf items in the TreeMap, the value of this property is used to map to the corresponding property in the DataSource, and the mapped value will be displayed as the text of the leaf items.

    Examples

    The below examples shows, how to set LabelPath property of TreeMapLeafItemSettings in the SfTreeMap.

    • XAML
    • C#
    • C#
    • C#
    <treemap:SfTreeMap x:Name="treeMap"
                       PrimaryValuePath="EmployeesCount"
                       DataSource="{Binding EmployeeDetails}">
       <treemap:SfTreeMap.BindingContext>
           <local:EmployeeViewModel />
       </treemap:SfTreeMap.BindingContext>
       <treemap:SfTreeMap.LeafItemSettings>
           <treemap:TreeMapLeafItemSettings LabelPath="JobDescription">
           </treemap:TreeMapLeafItemSettings>
       </treemap:SfTreeMap.LeafItemSettings>
       <treemap:SfTreeMap.LeafItemBrushSettings>
           <treemap:TreeMapUniformBrushSettings Brush="BlueViolet">
           </treemap:TreeMapUniformBrushSettings>
       </treemap:SfTreeMap.LeafItemBrushSettings>
    </treemap:SfTreeMap>
    public class EmployeeDetails
    {
       public string Category { get; set; }
       public string Country { get; set; }
       public string JobDescription { get; set; }
       public string JobGroup { get; set; }
       public int EmployeesCount { get; set; }
    }
    public class EmployeeViewModel
    {
        public EmployeeViewModel()
        {
           this.EmployeeDetails = new ObservableCollection<EmployeeDetails>()
           {
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Technical", JobGroup = "Testers", EmployeesCount = 100 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "HR Executives", EmployeesCount = 30 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Accounts", EmployeesCount = 40 },
           };
        }
       public ObservableCollection<EmployeeDetails> EmployeeDetails
       {
           get;
           set;
        }
    }
    this.treeMap.LeafItemSettings = new TreeMapLeafItemSettings() { LabelPath = "JobDescription" };
    See Also
    Stroke
    StrokeWidth
    Spacing
    TextStyle
    TextFormatOption

    Spacing

    Gets or sets the spacing between the leaf items in the SfTreeMap.

    Declaration
    public double Spacing { get; set; }
    Property Value
    Type Description
    System.Double

    The default value of Spacing is 1.

    Examples

    The below examples shows, how to set Spacing property of TreeMapLeafItemSettings in the SfTreeMap.

    • XAML
    • C#
    • C#
    • C#
    <treemap:SfTreeMap x:Name="treeMap"
                       PrimaryValuePath="EmployeesCount"
                       DataSource="{Binding EmployeeDetails}">
       <treemap:SfTreeMap.BindingContext>
           <local:EmployeeViewModel />
       </treemap:SfTreeMap.BindingContext>
       <treemap:SfTreeMap.LeafItemSettings>
           <treemap:TreeMapLeafItemSettings Spacing="1">
           </treemap:TreeMapLeafItemSettings>
       </treemap:SfTreeMap.LeafItemSettings>
       <treemap:SfTreeMap.LeafItemBrushSettings>
           <treemap:TreeMapUniformBrushSettings Brush="BlueViolet">
           </treemap:TreeMapUniformBrushSettings>
       </treemap:SfTreeMap.LeafItemBrushSettings>
    </treemap:SfTreeMap>
    public class EmployeeDetails
    {
       public string Category { get; set; }
       public string Country { get; set; }
       public string JobDescription { get; set; }
       public string JobGroup { get; set; }
       public int EmployeesCount { get; set; }
    }
    public class EmployeeViewModel
    {
        public EmployeeViewModel()
        {
           this.EmployeeDetails = new ObservableCollection<EmployeeDetails>()
           {
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Technical", JobGroup = "Testers", EmployeesCount = 100 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "HR Executives", EmployeesCount = 30 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Accounts", EmployeesCount = 40 },
           };
        }
       public ObservableCollection<EmployeeDetails> EmployeeDetails
       {
           get;
           set;
        }
    }
    this.treeMap.LeafItemSettings = new TreeMapLeafItemSettings() { Spacing = 1 };
    See Also
    Stroke
    StrokeWidth
    LabelPath
    TextStyle
    TextFormatOption

    Stroke

    Gets or sets the stroke color for the leaf items in the SfTreeMap.

    Declaration
    public Brush Stroke { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    The default value of Stroke is Brush.Transparent.

    Examples

    The below examples shows, how to set Stroke property of TreeMapLeafItemSettings in the SfTreeMap.

    • XAML
    • C#
    • C#
    • C#
    <treemap:SfTreeMap x:Name="treeMap"
                       PrimaryValuePath="EmployeesCount"
                       DataSource="{Binding EmployeeDetails}">
       <treemap:SfTreeMap.BindingContext>
           <local:EmployeeViewModel />
       </treemap:SfTreeMap.BindingContext>
       <treemap:SfTreeMap.LeafItemSettings>
           <treemap:TreeMapLeafItemSettings Stroke="Red">
           </treemap:TreeMapLeafItemSettings>
       </treemap:SfTreeMap.LeafItemSettings>
       <treemap:SfTreeMap.LeafItemBrushSettings>
           <treemap:TreeMapUniformBrushSettings Brush="BlueViolet">
           </treemap:TreeMapUniformBrushSettings>
       </treemap:SfTreeMap.LeafItemBrushSettings>
    </treemap:SfTreeMap>
    public class EmployeeDetails
    {
       public string Category { get; set; }
       public string Country { get; set; }
       public string JobDescription { get; set; }
       public string JobGroup { get; set; }
       public int EmployeesCount { get; set; }
    }
    public class EmployeeViewModel
    {
        public EmployeeViewModel()
        {
           this.EmployeeDetails = new ObservableCollection<EmployeeDetails>()
           {
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Technical", JobGroup = "Testers", EmployeesCount = 100 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "HR Executives", EmployeesCount = 30 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Accounts", EmployeesCount = 40 },
           };
        }
       public ObservableCollection<EmployeeDetails> EmployeeDetails
       {
           get;
           set;
        }
    }
    this.treeMap.LeafItemSettings = new TreeMapLeafItemSettings() { Stroke = Brush.Red };
    See Also
    StrokeWidth
    Spacing
    LabelPath
    TextStyle
    TextFormatOption

    StrokeWidth

    Gets or sets the width of the stroke for the leaf items in the SfTreeMap.

    Declaration
    public double StrokeWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The default value of StrokeWidth is 1.

    Examples

    The below examples shows, how to set StrokeWidth property of TreeMapLeafItemSettings in the SfTreeMap.

    • XAML
    • C#
    • C#
    • C#
    <treemap:SfTreeMap x:Name="treeMap"
                       PrimaryValuePath="EmployeesCount"
                       DataSource="{Binding EmployeeDetails}">
       <treemap:SfTreeMap.BindingContext>
           <local:EmployeeViewModel />
       </treemap:SfTreeMap.BindingContext>
       <treemap:SfTreeMap.LeafItemSettings>
           <treemap:TreeMapLeafItemSettings StrokeWidth="1">
           </treemap:TreeMapLeafItemSettings>
       </treemap:SfTreeMap.LeafItemSettings>
       <treemap:SfTreeMap.LeafItemBrushSettings>
           <treemap:TreeMapUniformBrushSettings Brush="BlueViolet">
           </treemap:TreeMapUniformBrushSettings>
       </treemap:SfTreeMap.LeafItemBrushSettings>
    </treemap:SfTreeMap>
    public class EmployeeDetails
    {
       public string Category { get; set; }
       public string Country { get; set; }
       public string JobDescription { get; set; }
       public string JobGroup { get; set; }
       public int EmployeesCount { get; set; }
    }
    public class EmployeeViewModel
    {
        public EmployeeViewModel()
        {
           this.EmployeeDetails = new ObservableCollection<EmployeeDetails>()
           {
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Technical", JobGroup = "Testers", EmployeesCount = 100 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "HR Executives", EmployeesCount = 30 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Accounts", EmployeesCount = 40 },
           };
        }
       public ObservableCollection<EmployeeDetails> EmployeeDetails
       {
           get;
           set;
        }
    }
    this.treeMap.LeafItemSettings = new TreeMapLeafItemSettings() { StrokeWidth = 1 };
    See Also
    Stroke
    Spacing
    LabelPath
    TextStyle
    TextFormatOption

    TextFormatOption

    Gets or sets the text format option for the leaf items in the SfTreeMap.

    Declaration
    public TextFormatOption TextFormatOption { get; set; }
    Property Value
    Type Description
    TextFormatOption

    The default value of TextFormatOption is Trim.

    Remarks

    This property will be applicable to only when the LabelPath is specified.

    Examples

    The below examples shows, how to set TextFormatOption property of TreeMapLeafItemSettings in the SfTreeMap.

    • XAML
    • C#
    • C#
    • C#
    <treemap:SfTreeMap x:Name="treeMap"
                       PrimaryValuePath="EmployeesCount"
                       DataSource="{Binding EmployeeDetails}">
       <treemap:SfTreeMap.BindingContext>
           <local:EmployeeViewModel />
       </treemap:SfTreeMap.BindingContext>
       <treemap:SfTreeMap.LeafItemSettings>
       <treemap:TreeMapLeafItemSettings LabelPath="JobDescription"
                                        TextFormatOption="Wrap">
         </treemap:TreeMapLeafItemSettings>
       </treemap:SfTreeMap.LeafItemSettings>
       <treemap:SfTreeMap.LeafItemBrushSettings>
           <treemap:TreeMapUniformBrushSettings Brush="BlueViolet">
           </treemap:TreeMapUniformBrushSettings>
       </treemap:SfTreeMap.LeafItemBrushSettings>
    </treemap:SfTreeMap>
    public class EmployeeDetails
    {
       public string Category { get; set; }
       public string Country { get; set; }
       public string JobDescription { get; set; }
       public string JobGroup { get; set; }
       public int EmployeesCount { get; set; }
    }
    public class EmployeeViewModel
    {
        public EmployeeViewModel()
        {
           this.EmployeeDetails = new ObservableCollection<EmployeeDetails>()
           {
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Technical", JobGroup = "Testers", EmployeesCount = 100 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "HR Executives", EmployeesCount = 30 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Accounts", EmployeesCount = 40 },
           };
        }
       public ObservableCollection<EmployeeDetails> EmployeeDetails
       {
           get;
           set;
        }
    }
    this.treeMap.LeafItemSettings = new TreeMapLeafItemSettings() { LabelPath = "JobDescription", TextFormatOption = TextFormatOption.Wrap };
    See Also
    Stroke
    StrokeWidth
    Spacing
    LabelPath
    TextStyle

    TextStyle

    Gets or sets the style of leaf item text, that used to customize the text color, font, font size, font family and font attributes.

    Declaration
    public TreeMapTextStyle TextStyle { get; set; }
    Property Value
    Type
    TreeMapTextStyle
    Remarks

    if the TextColor value is set, then the TextColor value will be applied as the text color for the leaf item. Otherwise, the luminosity of the brush LeafItemBrushSettings will determine the default text color. If the background color is light, the text color will be black; otherwise, the text color will be white. FontSize is 12, FontFamily is null, FontAttributes is Microsoft.Maui.Controls.FontAttributes.None

    It will be applicable to all LeafItemBrushSettings.
    Examples

    The below examples shows, how to set TextStyle property of TreeMapLeafItemSettings in the SfTreeMap.

    • XAML
    • C#
    • C#
    • C#
    <treemap:SfTreeMap x:Name="treeMap"
                       PrimaryValuePath="EmployeesCount"
                       DataSource="{Binding EmployeeDetails}">
       <treemap:SfTreeMap.BindingContext>
           <local:EmployeeViewModel />
       </treemap:SfTreeMap.BindingContext>
       <treemap:SfTreeMap.LeafItemSettings>
         <treemap:TreeMapLeafItemSettings>
           <treemap:TreeMapLeafItemSettings.TextStyle>
               <treemap:TreeMapTextStyle TextColor="Orange" FontAttributes="Italic" FontSize="12"/>
           </treemap:TreeMapLeafItemSettings.TextStyle>
         </treemap:TreeMapLeafItemSettings>
       </treemap:SfTreeMap.LeafItemSettings>
       <treemap:SfTreeMap.LeafItemBrushSettings>
           <treemap:TreeMapUniformBrushSettings Brush="BlueViolet">
           </treemap:TreeMapUniformBrushSettings>
       </treemap:SfTreeMap.LeafItemBrushSettings>
    </treemap:SfTreeMap>
    public class EmployeeDetails
    {
       public string Category { get; set; }
       public string Country { get; set; }
       public string JobDescription { get; set; }
       public string JobGroup { get; set; }
       public int EmployeesCount { get; set; }
    }
    public class EmployeeViewModel
    {
        public EmployeeViewModel()
        {
           this.EmployeeDetails = new ObservableCollection<EmployeeDetails>()
           {
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Technical", JobGroup = "Testers", EmployeesCount = 100 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "HR Executives", EmployeesCount = 30 },
               new EmployeeDetails() { Category = "Employees", Country = "India", JobDescription = "Accounts", EmployeesCount = 40 },
           };
        }
       public ObservableCollection<EmployeeDetails> EmployeeDetails
       {
           get;
           set;
        }
    }
    this.treeMap.LeafItemSettings = new TreeMapLeafItemSettings() { TextStyle = new TreeMapTextStyle() { TextColor = Colors.Orange, FontSize = 12, FontAttributes = FontAttributes.Italic } };
    See Also
    Stroke
    StrokeWidth
    Spacing
    LabelPath
    TextFormatOption

    Methods

    OnBindingContextChanged()

    Invokes on the binding context of the view changed.

    Declaration
    protected override void OnBindingContextChanged()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved