IAsyncRelayCommand{T}.cs 998 B

12345678910111213141516171819202122
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT license.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Threading.Tasks;
  5. namespace CommunityToolkit.Mvvm.Input;
  6. /// <summary>
  7. /// A generic interface representing a more specific version of <see cref="IAsyncRelayCommand"/>.
  8. /// </summary>
  9. /// <typeparam name="T">The type used as argument for the interface methods.</typeparam>
  10. /// <remarks>This interface is needed to solve the diamond problem with base classes.</remarks>
  11. public interface IAsyncRelayCommand<in T> : IAsyncRelayCommand, IRelayCommand<T>
  12. {
  13. /// <summary>
  14. /// Provides a strongly-typed variant of <see cref="IAsyncRelayCommand.ExecuteAsync"/>.
  15. /// </summary>
  16. /// <param name="parameter">The input parameter.</param>
  17. /// <returns>The <see cref="Task"/> representing the async operation being executed.</returns>
  18. Task ExecuteAsync(T? parameter);
  19. }