using System.Windows.Threading; namespace Azaion.Common.Services; public class WpfUICommandDispatcher : IUICommandDispatcher { private readonly Dispatcher _dispatcher; public WpfUICommandDispatcher(Dispatcher dispatcher) { _dispatcher = dispatcher; } public Task ExecuteAsync(Action action) { return _dispatcher.InvokeAsync(action).Task; } public Task ExecuteAsync(Func func) { return _dispatcher.InvokeAsync(func).Task; } public void Execute(Action action) { _dispatcher.Invoke(action); } }