mirror of
https://github.com/unclshura/splitter.git
synced 2026-06-22 00:22:01 +00:00
16 lines
512 B
C#
16 lines
512 B
C#
using System.Globalization;
|
|
using Avalonia.Data.Converters;
|
|
|
|
namespace Splitter_UI.Converters;
|
|
|
|
public sealed class BoolInvertConverter : IValueConverter
|
|
{
|
|
public static readonly BoolInvertConverter Instance = new();
|
|
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> value is bool b ? !b : value;
|
|
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
=> value is bool b ? !b : value;
|
|
}
|