added dispatcher service
This commit is contained in:
parent
814cb58742
commit
3cda100d82
8
Services/ISynchronizaionService.cs
Normal file
8
Services/ISynchronizaionService.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace BetterRaid.Services;
|
||||
|
||||
public interface ISynchronizaionService
|
||||
{
|
||||
void Invoke(Action action);
|
||||
}
|
18
Services/Implementations/DispatcherService.cs
Normal file
18
Services/Implementations/DispatcherService.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Avalonia.Threading;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
namespace BetterRaid.Services.Implementations;
|
||||
public class DispatcherService : ISynchronizaionService
|
||||
{
|
||||
private readonly Dispatcher dispatcher;
|
||||
|
||||
public DispatcherService(Dispatcher dispatcher)
|
||||
{
|
||||
this.dispatcher = dispatcher;
|
||||
}
|
||||
public void Invoke(Action action)
|
||||
{
|
||||
dispatcher.Invoke(action);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user