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

namespace DemoLib.Converter
{
    public class ByteLengthInHexLengthConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                int byteValue = Int32.Parse(value.ToString());
                return byteValue * 2;
            }
            catch (Exception e)
            {
                return 0;
            }
        }

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