27 lines
726 B
C#
27 lines
726 B
C#
using Avalonia.Data.Converters;
|
|
using Avalonia.Media;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace demo_trade.UI.Converters
|
|
{
|
|
|
|
public class ItemColorConverter : IValueConverter
|
|
{
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
|
|
return (short?)value > 15? new SolidColorBrush(Colors.Yellow) : new SolidColorBrush(Colors.White);
|
|
}
|
|
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
}
|
|
}
|