using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace TwitterClient.Converters
{
    class LengthToDescriptionConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            int num = int.Parse(value.ToString());
            num = 140 - num;
            return (num == 1 ? "Pozostał " + num + " znak" : num >= 2 && num <= 4 ? "Pozostały " + num + " znaki" : "Pozostało " + num + " znaków");
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
