mirror of
https://github.com/azaion/annotations.git
synced 2026-04-23 05:06:31 +00:00
big refactoring. get rid of static properties and coupled architecture. prepare system for integration tests
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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<T> ExecuteAsync<T>(Func<T> func)
|
||||
{
|
||||
return _dispatcher.InvokeAsync(func).Task;
|
||||
}
|
||||
|
||||
public void Execute(Action action)
|
||||
{
|
||||
_dispatcher.Invoke(action);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user