SunburstLabelPresentation.Text Property
In This Article
Specifies the label text.
Namespace: DevExpress.Xpf.TreeMap
Assembly: DevExpress.Xpf.TreeMap.v24.2.dll
NuGet Package: DevExpress.Wpf.TreeMap
#Declaration
#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