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

namespace AppFramework.Converters
{
    public class ImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                var val = value.ToString().Split(" ");
                return $"/Assets/Images/flags/{val[1].ToString()}.png";
            }
            return value;
        }

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