using AI.Utils; using Avalonia.Data.Converters; using System; using System.Globalization; namespace AI.Converters { public class FileSizeConverter : IValueConverter { public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { if (value is long fileSize) { return FileUnit.FormatFileSize(fileSize); } return "0 B"; } public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { throw new NotImplementedException(); } } }