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

namespace Platform.Controls.TableContainer
{
    public class LevelToIndentConverter : IValueConverter
    {
        private static double _indentSize = 10.0;

        /// <summary>
        /// 获取或设置缩进
        /// </summary>
        public static double IndentSize
        {
            get { return LevelToIndentConverter._indentSize; }
            set { LevelToIndentConverter._indentSize = value; }
        }

        public object Convert(object o, Type type, object parameter, CultureInfo culture)
        {
            return new Thickness((int)o * _indentSize, 0, 0, 0);
        }

        public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}
