Class SpeedConverter
- Namespace
- Tudormobile.Strava.UI.Converters
- Assembly
- Tudormobile.Strava.UI.dll
Converts speed values to formatted string representations based on the specified unit.
public class SpeedConverter : IValueConverter
- Inheritance
-
SpeedConverter
- Implements
- Inherited Members
Methods
Convert(object?, Type, object?, CultureInfo?)
Converts a speed value to a formatted string representation based on the specified unit.
public object Convert(object? value, Type targetType, object? parameter, CultureInfo? culture = null)
Parameters
valueobjectThe value to convert. Can be a SummaryActivity, ActivityView, double, or string.
targetTypeTypeThe type of the binding target property.
parameterobjectThe converter parameter to use. Specify "meters" to use metric units.
cultureCultureInfoThe culture to use in the converter.
Returns
- object
A formatted string representing the speed in either km/h or mph.
Exceptions
- NotSupportedException
Thrown if the value type is not supported.
ConvertBack(object?, Type, object?, CultureInfo?)
Converts a value back to its original type. This method is not implemented.
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo? culture = null)
Parameters
valueobjectThe value that is produced by the binding target.
targetTypeTypeThe type to convert to.
parameterobjectThe converter parameter to use.
cultureCultureInfoThe culture to use in the converter.
Returns
- object
Throws a NotImplementedException.
Exceptions
- NotImplementedException
Always thrown as this method is not implemented.