Refactor InvertedProgressConverter for readability

This commit is contained in:
Philipp Heenemann 2023-07-12 09:29:02 +02:00
parent a8b91f4ee6
commit c98c59edf2

View File

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