JD2022-TU1/main/tools/framework/JD.WPF/Converters/TimeSpanToStringConverter.cs

21 lines
582 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
using JD.Core;
namespace JD.WPF.Converters
{
public class TimeSpanToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
TimeSpan timeSpan = (TimeSpan)value;
return timeSpan.ToReadableString();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}