30 lines
781 B
C#
30 lines
781 B
C#
using System;
|
|
using System.Globalization;
|
|
using Gallery.UI;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Gallery.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();
|
|
}
|
|
}
|
|
}
|