using Avalonia.Threading;

namespace ZB.MOM.WW.OtOpcUa.Client.UI.Services;

/// <summary>
///     Dispatches actions to the Avalonia UI thread.
/// </summary>
public sealed class AvaloniaUiDispatcher : IUiDispatcher
{
    /// <summary>Posts an action to the Avalonia UI thread for execution.</summary>
    /// <param name="action">The action to execute on the UI thread.</param>
    public void Post(Action action)
    {
        Dispatcher.UIThread.Post(action);
    }
}