ToBoolMutiValueConverter9.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. using Venus_Core;
  8. namespace Venus_Themes.Converters
  9. {
  10. public class ToBoolMultiValueConverter9 : IMultiValueConverter
  11. {
  12. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  13. {
  14. if (values == null) return false;
  15. if ((bool)values[0] == false && (bool)values[1] == false && (bool)values[2] == false)
  16. {
  17. return false;
  18. }
  19. for (int i = 3; i < values.Length; i++)
  20. {
  21. if (values== null) return null;
  22. if ((bool)values[i] == true)
  23. {
  24. return true;
  25. }
  26. }
  27. return false;
  28. }
  29. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
  30. {
  31. throw new NotImplementedException();
  32. }
  33. }
  34. }