Files
CapMachine/CapMachine.Shared/Controls/BoolNgConvert.cs
2024-09-25 15:44:59 +08:00

32 lines
794 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace CapMachine.Shared.Controls
{
public class BoolNgConvert : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool booleanValue)
{
return !booleanValue;
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool booleanValue)
{
return !booleanValue;
}
return value;
}
}
}