SPT-AKI-Installer/SPTInstaller/Converters/InvertedProgressConverter.cs
2024-05-01 10:31:55 -04:00

27 lines
649 B
C#

using System.Globalization;
using Avalonia.Data.Converters;
namespace SPTInstaller.Converters;
public class InvertedProgressConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is int progress)
{
return 100 - progress;
}
return value;
}
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is int invertedProgress)
{
return 100 - invertedProgress;
}
return value;
}
}