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 ItemComboboxConverter : IValueConverter { public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { string status = (string)value; return status == "Новый" ? 0: 1; } public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { int status = (int)value; return status != 0 ? "Завершен" : "Новый"; } } }