WeightValuePath in WPF TreeMap (SfTreeMap)

7 May 20211 minute to read

The WeightValuePath ofSfTreeMap is a path to a field on the source object, which serve as the “weight” of the object.

  • XAML
  • <Grid Background="Black">
    
            <Grid.DataContext>
    
                <local:PopulationViewModel/>
    
            </Grid.DataContext>
    
            <syncfusion:SfTreeMap ItemsSource="{Binding PopulationDetails}" 
    
                                  WeightValuePath="Population”/>
    
        </Grid>

    NOTE

    The specified field must be available in each and every sub class (object) defined in hierarchical (nested) data collection.

    WeightValuePath_img1