AnyMultiValueConverter.cs 971 B

1234567891011121314151617181920212223242526272829303132333435
  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;
  7. using System.Windows.Data;
  8. namespace CyberX8_MainPages.Converters
  9. {
  10. public class AnyMultiValueConverter : IMultiValueConverter
  11. {
  12. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  13. {
  14. foreach (var item in values)
  15. {
  16. if (item == DependencyProperty.UnsetValue)
  17. {
  18. continue;
  19. }
  20. if ( (bool)item == true)
  21. {
  22. return true;
  23. }
  24. }
  25. return false;
  26. }
  27. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
  28. {
  29. return null;
  30. }
  31. }
  32. }