using System;
//using System.Collections.Generic;
using System.Globalization;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media.Imaging;

namespace Karaoke_Kingpin.Converters
{
    public class ImagePathConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return null;

            string imagePath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, value.ToString());
            return new BitmapImage(new Uri(imagePath));
        }

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