Files
FileConverter/Application/FileConverter/ValueConverters/BitrateToString.cs
T
2015-08-22 15:50:19 +02:00

28 lines
892 B
C#

// <copyright file="BitrateToString.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
namespace FileConverter.ValueConverters
{
using System;
using System.Globalization;
using System.Windows.Data;
public class BitrateToString : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!(value is double))
{
throw new ArgumentException("The value must be a double value.");
}
double bitrate = (double)value;
return string.Format("{0} kbit/s", bitrate.ToString("0"));
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}