Instruments are Panels that include:

  • a scale which is a "Graduated" Panel showing a possible range of values
  • one or more indicators that show the instrument's value

Optionally there are other TextBlocks or Shapes that show additional information. Indicators can be Shapes or TextBlocks or more complicated Panels. For more about scales, please read Graduated Panels. For simplicity, all of these instruments only show one value. But you could define instruments that show multiple values on the same scale, or that have multiple scales.

When an instrument is also a control, the user can modify the instrument's value. When the instrument is editable, there may be a handle that the user can drag. This might be the same as the indicator or might be a different object.

This sample defines five different types of instruments.

  • Horizontal, a horizontal scale with a bar indicator and a slider handle
  • Vertical, a vertical scale with a bar indicator and a slider handle
  • NeedleMeter, a curved scale with a straight needle indicator
  • CircularMeter, a circular scale with a polygonal needle indicator
  • BarMeter, a circular scale with an annular bar indicator

The value to be shown by the instrument is assumed to be the data.value property. The value is shown both textually in a TextBlock and graphically using an indicator on the scale. If the value of data.editable is true,

  • the user can drag something to change the instrument's value -- the value is limited by the Panel.graduatedMin and Panel.graduatedMax values
  • the user can in-place edit the TextBlock showing the value (if the node is selected, hit the F2 key)

Of course you can change the details of anything you want to use. You might want to add more TextBlocks to show more information. A few properties already have data Bindings, such as:

  • TextBlock.text from data.text, for the name of the instrument
  • Panel.graduatedMin from data.min, to control the range of the scale
  • Panel.graduatedMax from data.max, to control the range of the scale
  • (various) from data.color, to control some colors used by the instrument