WPF Dashboard
A library of simple dashboard controls for WPF.
Currently only has one control: Dial360.
Dial360 Usage
Add a reference to the Dashboard project and embed the Dial360 control like this:
<dashboard:Dial360 Minimum="{Binding Min}"
Maximum="{Binding Max}"
Value="{Binding Value}" />
Dial360 uses the INotifyPropertyChanged
interface to monitor the bindings.
Whenever the Value property changes the needle is animated to the new value.
By default the Dial tries to intelligently create a range of "notches" based on
the range of values between Minimum
and Maximum
. You can override this behaviour
by instead explicitly binding an IEnumerable<Dial360Notch>
collection to the Notches
property.
<dashboard:Dial360
...
Notches="{Binding MyNotches}" />
Where MyNotches might be defined as...
... = new ObservableCollection<Dial360Notch> {
new Dial360Notch(label: "A", angle: -150),
new Dial360Notch(label: "B", angle: 150)
};
If the collection implements INotifyCollectionChanged
then Dial360 monitors this collection
for changes directly.
All of the properties which can be bound are:
Value
(double
) - the current "value" of the needle.AnimationDuration
(TimeSpan
) - the duration of the needle animation when Value updates.Minimum
(double
) - the minimum value expected from Value. Animations are clamped to this.Maximum
(double
) - the maximum value expected from Value. Animations are clamped to this.Label
(string
) - the text rendered in the center of the dial.Notches
(IEnumerable<Dial360Notch>
) - the collection of notches which describe the range of the dial.DefaultNotchCount
(int
) - the number of notches rendered if theNotches
property is not set.