| 123456789101112131415161718 |
- using System;
- using System.Globalization;
- using System.Windows.Data;
- namespace TeamAAS.FlowEditor.Converters
- {
- /// <summary>
- /// bool 取反转换器(用于"只读模式 → 禁用按钮"的 IsEnabled 绑定)。
- /// </summary>
- public class InverseBoolConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- => !(value is bool b && b);
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- => !(value is bool b && b);
- }
- }
|