4 using System.Globalization;
6 namespace SiliconStudio.Presentation.ValueConverters
14 public override object Convert(
object value, Type targetType,
object parameter, CultureInfo culture)
16 var timeSpan = (TimeSpan)value;
17 return timeSpan.TotalSeconds;
21 public override object ConvertBack(
object value, Type targetType,
object parameter, CultureInfo culture)
23 double seconds = System.Convert.ToDouble(value);
24 return TimeSpan.FromSeconds(seconds);
override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
This value converter will convert a TimeSpan to double by using the TimeSpan.TotalSeconds property...
override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)