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

Scale.CustomLabelsSource Property

Gets or sets a source of custom labels.

Namespace: DevExpress.Xpf.Gauges

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

NuGet Package: DevExpress.Wpf.Gauges

#Declaration

public IEnumerable CustomLabelsSource { get; set; }

#Property Value

Type Description
IEnumerable

A source of custom labels.

#Remarks

Use the CustomLabelTemplate property to specify a custom template that generates custom labels.

<Style TargetType="{x:Type dxga:ArcScale}">
    <Setter Property="CustomLabelsSource" Value="{Binding RomanLabels}"/>
    <Setter Property="CustomLabelTemplate">
        <Setter.Value>
            <DataTemplate>
                <dxga:ScaleCustomLabel Value="{Binding Hour}"
                                       Content="{Binding RomanHour}"
                                       Visible="{Binding Visible}"/>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style> 
public class WorldTimeViewModel {
    public IEnumerable<HourLabelData> RomanLabels { get; private set; }
}

public class HourLabelData : BindableBase {
    public int Hour { get; private set; }
    public string RomanHour { get; private set; }
    public bool Visible {
        get { return GetProperty(() => Visible); }
        set { SetProperty(() => Visible, value); }
    }

    public HourLabelData(int hour) {
        Hour = hour;
        RomanHour = romanHours[hour - 1];
    }
    static string[] romanHours = 
        new string[] { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" };
}

Run Demo: Circular Scales

See Also