Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SunburstLabelPresentation.Text Property

Specifies the label text.

Namespace: DevExpress.Xpf.TreeMap

Assembly: DevExpress.Xpf.TreeMap.v24.2.dll

NuGet Package: DevExpress.Wpf.TreeMap

#Declaration

public string Text { get; set; }

#Property Value

Type Description
String

The label text.

#Remarks

The following example uses the Text property to customize sector labels, and display the Family data source field for group items, and the AtomicMass field for child items. In this example, Sunburst is bound to a list of ChemicalElement objects.

<dxtm:SunburstControl >
  <dxtm:SunburstControl.LabelStyle>
    <Style TargetType="{x:Type dxtm:SunburstLabelPresentation}">
      <Setter Property="Text" Value="{Binding Path=SourceObject, Converter={local:ElementToTextConverter}}" />
    </Style>
  </dxtm:SunburstControl.LabelStyle>
</dxtm:SunburstControl>
public class ElementToTextConverter : MarkupExtension, IValueConverter {
  public override object ProvideValue(IServiceProvider serviceProvider) {
      return this;
  }

  object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture) {
      List<object> list = value as List<object>;
      if (list != null)
          return (list[0] as ChemicalElement).Family;
      return (value as ChemicalElement)?.AtomicMass;
  }

  object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
      return null;
  }
}
See Also