using System;
using System.Globalization;
using System.Windows.Data;
namespaceCommon.WPF.Converters
{
///<summary>/// Convert Level to left margin/// Pass a prarameter if you want a unit length other than default.///</summary>publicclassLevelToIndentConverter : IValueConverter
{
publicobjectConvert(object o, Type type, object parameter, CultureInfo culture)
{
double indentSize = 5;
if (parameter != null)
double.TryParse(parameter.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out indentSize);
return (int)o * indentSize + " 0 0 0";
}
publicobjectConvertBack(object o, Type type, object parameter, CultureInfo culture)
{
thrownew NotSupportedException();
}
}
}