You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastermind/Sources/MauiSpark/Convertisseurs/IndicateurVersCouleurMAUI.cs

33 lines
962 B

using CoreLibrary.Core;
using System.Globalization;
namespace MauiSpark.Convertisseurs
{
public class IndicateurVersCouleurMAUI : IValueConverter
{
public static Color Noir { get; private set; } = Color.FromArgb("#000000");
public static Color Blanc { get; private set; } = Color.FromArgb("#FFFFFF");
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is not Indicateur) return Noir;
switch (value)
{
case Indicateur.BonnePlace:
return Noir;
case Indicateur.BonneCouleur:
return Blanc;
default:
return Noir;
}
}
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}