VisibilityConverter.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Data;
  6. namespace Aitex.Core.Util
  7. {
  8. /// <summary>
  9. /// 其中有一项为true就是true
  10. /// </summary>
  11. public class FlowConverterForAllTrueMultiBinding : IMultiValueConverter
  12. {
  13. #region IMultiValueConverter 成员
  14. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  15. {
  16. string str_Result = string.Empty;
  17. bool isOpen = false;
  18. for (int i = 0; i < values.Length; i++)
  19. {
  20. bool.TryParse(values.GetValue(i) + "", out isOpen);
  21. if (isOpen == true)
  22. return isOpen;
  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. #endregion
  31. }
  32. }