21 lines
579 B
C#
21 lines
579 B
C#
using Avalonia.Data.Converters;
|
|
using System;
|
|
using System.Globalization;
|
|
|
|
namespace Project_Periodensystem.View.Converters
|
|
{
|
|
public class BoolToScaleXConverter : IValueConverter
|
|
{
|
|
public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
bool flipped = value is bool b && b;
|
|
return flipped ? -1 : 1;
|
|
}
|
|
|
|
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
}
|
|
}
|