ToBoolMultiValueConverter6.cs 1.0 KB

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