Files
29WxOrder/Source/MAX.Framework/PrismExtension/Commands/IAsyncCommand.cs
T
2026-08-31 16:28:23 +08:00

28 lines
1.0 KiB
C#

using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Prism.Commands
{
/// <summary>
/// Provides an abstraction layer for custom controls which want to make use of Async Commands
/// </summary>
public interface IAsyncCommand : ICommand
{
/// <summary>
/// Executes the Command with a specified parameter and the Default <see cref="CancellationToken"/>.
/// </summary>
/// <param name="parameter">The Command Parameter</param>
/// <returns>An Asynchronous Task</returns>
Task ExecuteAsync(object parameter);
/// <summary>
/// Executes the Command with a specified parameter and using a <see cref="CancellationToken"/>
/// </summary>
/// <param name="parameter">The Command Parameter</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/>.</param>
/// <returns>An Asynchronous Task</returns>
Task ExecuteAsync(object parameter, CancellationToken cancellationToken);
}
}