1234567891011121314151617181920 |
- using System;
- using System.Globalization;
- using Avalonia.Data.Converters;
- namespace SukiUI.Converters.WaveProgress;
- public class WaveProgressValueTextConverter : IValueConverter
- {
- public static readonly WaveProgressValueTextConverter Instance = new();
- public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- return value is not double d ? "0%" : $"{d:#0}%";
- }
- public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
- {
- throw new NotSupportedException();
- }
- }
|