VPet/VPet.Solution/Converters/ConverterBase/MultiValueToBoolConverter.cs

32 lines
776 B
C#
Raw Permalink Normal View History

2023-12-30 15:50:37 +00:00
using System.ComponentModel;
using System.Windows;
namespace HKW.WPF.Converters;
/// <summary>
/// 转换至布尔转换器基础
/// </summary>
public abstract class MultiValueToBoolConverter<T> : MultiValueConverterBase
where T : MultiValueToBoolConverter<T>
{
/// <summary>
///
/// </summary>
public static readonly DependencyProperty TargetBoolValueProperty = DependencyProperty.Register(
nameof(TargetBoolValue),
typeof(bool),
typeof(T),
new PropertyMetadata(false)
);
/// <summary>
/// 指定值
/// </summary>
[DefaultValue(false)]
public bool TargetBoolValue
{
get => (bool)GetValue(TargetBoolValueProperty);
set => SetValue(TargetBoolValueProperty, value);
}
}