ToBoolMultiValueConverter.cs 819 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Data;
  7. namespace CyberX8_Themes.Converters
  8. {
  9. public class ToBoolMultiValueConverter : IMultiValueConverter
  10. {
  11. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  12. {
  13. foreach (var item in values)
  14. {
  15. if ((bool)item == false)
  16. {
  17. return false;
  18. }
  19. }
  20. return true;
  21. }
  22. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
  23. {
  24. return null;
  25. }
  26. }
  27. }