Creating Horizontal Gauge

This tutorial will guide you in creating a trivial horizontal gauge and will explain the following:

Add horizontal scale
  1. Add namespaces.

    Unfortunately .NET for Windows Store applications still doesn't support XmlnsDefinition attribute so we have to specify separate namespace for every part of the class library. To use the horizontal scale control and its components in XAML you have to declare the following namespaces:

    [XAML]
  2. Add scale. Set its minimum and maximum values.

    [XAML]

Here is a snapshot of the result:

Manco Gauge control - Horizontal scale

Add an indicator
The HorizontalScale control allows you to display different types of indicators (except Needle) that point to a value of the scale. All indicators should be placed inside the IndicatorList element which is of type ItemsControl. This means that you can specify more than one indicator for 1 scale. Here is an example of HorizontalScale that uses a Marker indicator to mark the current value.

[XAML]

Here is a snapshot of the result:

Manco Gauge control - Horizontal scale with marker

Set an indicator's value
To position indicator you have to use its Value property. Here is an example:

[XAML]

Here is a snapshot of the result:

Manco Gauge control - Horizontal scale with marker