1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
- namespace ShakerManger.Convert
- {
- public class MultiBoolConverter : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- if (values == null || values.Length == 0) return false;
- try
- {
- if (parameter != null) return values.Cast<bool>().Any(x => !x);
- return !values.Cast<bool>().Any(x => !x);
- }
- catch
- {
- return false;
- }
- }
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|