using System;
using System.Windows;
using System.Windows.Data;
using System.Globalization;

namespace Elwig.Controls {
    public class WidthToPaddingConverter : IValueConverter {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
            return new Thickness(2, 2, 4 + (double)value, 2);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
            return ((Thickness)value).Right - 4;
        }
    }
}
