mirror of
https://github.com/sp-tarkov/installer.git
synced 2025-02-13 04:50:46 -05:00
27 lines
649 B
C#
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;
|
|
}
|
|
} |