BoolConverters.cs 663 B

12345678910111213141516171819
  1. // Copyright (c) The Avalonia Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System.Linq;
  4. namespace Avalonia.Data.Converters
  5. {
  6. /// <summary>
  7. /// Provides a set of useful <see cref="IValueConverter"/>s for working with string values.
  8. /// </summary>
  9. public static class BoolConverters
  10. {
  11. /// <summary>
  12. /// A multi-value converter that returns true if all inputs are true.
  13. /// </summary>
  14. public static readonly IMultiValueConverter And =
  15. new FuncMultiValueConverter<bool, bool>(x => x.All(y => y));
  16. }
  17. }