using System.ComponentModel; using System.Windows; namespace HKW.WPF.Converters; /// /// 含有比率的转换器 /// /// 转换器类型 public abstract class HaveRatioConverter : MultiValueConverterBase where T : HaveRatioConverter { /// /// /// public static readonly DependencyProperty HaveRatioProperty = DependencyProperty.Register( nameof(HaveRatio), typeof(bool), typeof(T), new PropertyMetadata(false) ); /// /// 含有比例 /// [DefaultValue(false)] public bool HaveRatio { get => (bool)GetValue(HaveRatioProperty); set => SetValue(HaveRatioProperty, value); } }