menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class TreeMapPaletteBrushSettings

    Provides settings for customizing the palette brushes in the SfTreeMap.

    Inheritance
    System.Object
    TreeMapBrushSettings
    TreeMapPaletteBrushSettings
    Namespace: Syncfusion.Maui.TreeMap
    Assembly: Syncfusion.Maui.TreeMap.dll
    Syntax
    public class TreeMapPaletteBrushSettings : TreeMapBrushSettings

    Constructors

    TreeMapPaletteBrushSettings()

    Declaration
    public TreeMapPaletteBrushSettings()

    Fields

    BrushesProperty

    Identifies the Brushes dependency property.

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

    The identifier for Brushes dependency property.

    Properties

    Brushes

    Gets or sets the list of brushes used for the palette in the SfTreeMap.

    Declaration
    public List<Brush> Brushes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<Microsoft.Maui.Controls.Brush>

    The default value of Brushes is an empty list of brushes.

    Examples

    The below examples shows, how to set Brushes property of TreeMapPaletteBrushSettings 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.LeafItemBrushSettings>
           <treemap:TreeMapPaletteBrushSettings>
               <treemap:TreeMapPaletteBrushSettings.Brushes>
                   <SolidColorBrush>#116DF9</SolidColorBrush>
                   <SolidColorBrush>#9215F3</SolidColorBrush>
                   <SolidColorBrush>#F4890B</SolidColorBrush>
               </treemap:TreeMapPaletteBrushSettings.Brushes>
           </treemap:TreeMapPaletteBrushSettings>
       </treemap:SfTreeMap.LeafItemBrushSettings>
       <treemap:SfTreeMap.LeafItemSettings>
           <treemap:TreeMapLeafItemSettings LabelPath="JobDescription">
           </treemap:TreeMapLeafItemSettings>
       </treemap:SfTreeMap.LeafItemSettings>
    </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.LeafItemBrushSettings = new TreeMapPaletteBrushSettings()
    {
        Brushes = new List<Brush>()
        {
            new SolidColorBrush(Color.FromArgb("#116DF9")),
            new SolidColorBrush(Color.FromArgb("#9215F3")),
            new SolidColorBrush(Color.FromArgb("#F4890B")),
        }
    };
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved