ToBoolMultiValueConverter6.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 ToBoolMultiValueConverter6 : 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))
  16. {
  17. return false;
  18. }
  19. if ((bool)values[1] == true && (bool)values[2] == true)
  20. {
  21. return true;
  22. }
  23. for (int i = 3; i < values.Length; i++)
  24. {
  25. if ((bool)values[i] == true)
  26. {
  27. return true;
  28. }
  29. }
  30. return false;
  31. }
  32. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
  33. {
  34. throw new NotImplementedException();
  35. }
  36. }
  37. }