VPet/VPet.Solution/Converters/ConverterBase/CanInverterValueConverter.cs
2023-12-30 23:50:37 +08:00

32 lines
753 B
C#

using System.ComponentModel;
using System.Windows;
namespace HKW.WPF.Converters;
/// <summary>
/// 可反转值转换器
/// </summary>
public abstract class CanInverterValueConverter<T> : ValueConverterBase
where T : CanInverterValueConverter<T>
{
/// <summary>
///
/// </summary>
public static readonly DependencyProperty InverterProperty = DependencyProperty.Register(
nameof(Inverter),
typeof(bool),
typeof(AllIsBoolToVisibilityConverter),
new PropertyMetadata(false)
);
/// <summary>
/// 反转
/// </summary>
[DefaultValue(false)]
public bool Inverter
{
get => (bool)GetValue(InverterProperty);
set => SetValue(InverterProperty, value);
}
}