using System; using System.Globalization; using System.Windows; using System.Windows.Data; namespace SourceGit.Converters { /// /// Convert indent(horizontal offset) to Margin property /// public class IndentToMargin : IValueConverter { /// /// Implement IValueConverter.Convert /// /// /// /// /// /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return new Thickness((double)value, 0, 0, 0); } /// /// Implement IValueConverter.ConvertBack /// /// /// /// /// /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return ((Thickness)value).Left; } } }