using System;
using System.Globalization;
using Pixiview.UI;
using Xamarin.Forms;

namespace Pixiview.Utils
{
    public class FavoriteIconConverter : IValueConverter
    {
        private readonly bool isFavorite;

        public FavoriteIconConverter(bool favorite)
        {
            isFavorite = favorite;
        }

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value == null ?
                isFavorite ? StyleDefinition.IconLove : string.Empty :
                StyleDefinition.IconCircleLove;
        }

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