Skip to main content
A newer version of this page is available. .
All docs
V20.2

SunburstLabelPresentation.Text Property

Specifies the label text.

Namespace: DevExpress.Xpf.TreeMap

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.TreeMap, 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