MindFusion.Wpf Pack Programmer's Guide
BaseScale.QueryLabelValue Event
See Also
 





Occurs when the labels in the scale are being generated in order to associate custom values with them.

Namespace: MindFusion.Gauges.Wpf
Assembly: MindFusion.Gauges.Wpf

 Syntax

C#  Copy Code

public event EventHandler<QueryLabelValueEventArgs> QueryLabelValue

Visual Basic  Copy Code

Public Event QueryLabelValue As EventHandler(Of QueryLabelValueEventArgs)

 Event Data

QueryLabelValue event handlers receive an argument of type QueryLabelValueEventArgs.

 Remarks

This event is raised in order to allow clients to customize the texts of tick labels beyond simple formatting.

 Example

The following example illustrates a QueryLabelValue event handler which customizes the labels of a scale to display "Empty" as min value and "Full" as max value:

C#  Copy Code

private void OnQueryLabelValue(object sender, QueryLabelValueEventArgs e)
{
    var baseScale = sender as BaseScale;
    if (e.Settings.TickType == TickType.Major)
    {
        if (e.CalculatedLabelValue == baseScale.MinValue)
            e.NewValue = "Empty";
        if (e.CalculatedLabelValue == baseScale.MaxValue)
            e.NewValue = "Full";
    }
}

Visual Basic  Copy Code

Private Sub OnQueryLabelValue(ByVal sender As System.Object, ByVal e As QueryLabelValueEventArgs)

    Dim baseScale = CType(sender, BaseScale)
    If (e.Settings.TickType = TickType.Major) Then

        If (e.CalculatedLabelValue = baseScale.MinValue) Then
            e.NewValue = "Empty"
        End If
        If (e.CalculatedLabelValue = baseScale.MaxValue) Then
            e.NewValue = "Full"
        End If

    End If

End Sub

 See Also

BaseScale Members
BaseScale Class
MindFusion.Gauges.Wpf Namespace