C# Class WpfConverters.Number2ColorConverter

Convert a number in the range 0..100 to a color, where 0 is green and 100 is red.
Inheritance: System.Windows.Markup.MarkupExtension, IValueConverter
Mostrar archivo Open project: TNOCS/csTouch Class Usage Examples

Public Methods

Method Description
Convert ( object value, Type targetType, object parameter, CultureInfo culture ) : object
ConvertBack ( object value, Type targetType, object parameter, CultureInfo culture ) : object
ProvideValue ( IServiceProvider serviceProvider ) : object

Private Methods

Method Description
scaleInputBetweenGreenAndRed ( double inputValue ) : Color

Scale the input value, in the range of [0..100] to green (0), yellow (50) and red (100).

Method Details

Convert() public method

public Convert ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object
targetType System.Type
parameter object
culture System.Globalization.CultureInfo
return object

ConvertBack() public method

public ConvertBack ( object value, Type targetType, object parameter, CultureInfo culture ) : object
value object
targetType System.Type
parameter object
culture System.Globalization.CultureInfo
return object

ProvideValue() public method

public ProvideValue ( IServiceProvider serviceProvider ) : object
serviceProvider IServiceProvider
return object