Skip to main content
All docs
V25.1
  • SunburstLabelPresentation.Text Property

    Specifies the label text.

    Namespace: DevExpress.Xpf.TreeMap

    Assembly: DevExpress.Xpf.TreeMap.v25.1.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