Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  2. {
  3. return ((TimeSpan)value).TotalSeconds.ToString(CultureInfo.InvariantCulture);
  4. }
  5.  
  6. /// <see cref="IValueConverter.ConvertBack"/>
  7. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  8. {
  9. return TimeSpan.FromSeconds(int.Parse((string) value, NumberStyles.None, CultureInfo.InvariantCulture));
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement