ToBoolMutiValueConverter5.cs 991 B

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