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

namespace LogicalPaging
{
    public class PageIndexToCharConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int pageNumber = System.Convert.ToInt32(value);

            return Convert(pageNumber - 1);
        }

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

        public static char Convert(int pageIndex)
        {
            return (char)(pageIndex + 'a');
        }
    }
}
