diff --git a/Services/ISynchronizaionService.cs b/Services/ISynchronizaionService.cs new file mode 100644 index 0000000..92f7aa8 --- /dev/null +++ b/Services/ISynchronizaionService.cs @@ -0,0 +1,8 @@ +using System; + +namespace BetterRaid.Services; + +public interface ISynchronizaionService +{ + void Invoke(Action action); +} diff --git a/Services/Implementations/DispatcherService.cs b/Services/Implementations/DispatcherService.cs new file mode 100644 index 0000000..124215e --- /dev/null +++ b/Services/Implementations/DispatcherService.cs @@ -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); + } +}