feat(launcher): Campaign LA add Avalonia desktop shell
This commit is contained in:
parent
6c4cd2bbc6
commit
d0a9c65d85
31 changed files with 4831 additions and 16 deletions
26
src/AcDream.Launcher/ViewModels/IUiDispatcher.cs
Normal file
26
src/AcDream.Launcher/ViewModels/IUiDispatcher.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using Avalonia.Threading;
|
||||
|
||||
namespace AcDream.Launcher.ViewModels;
|
||||
|
||||
public interface IUiDispatcher
|
||||
{
|
||||
void Post(Action action);
|
||||
}
|
||||
|
||||
public sealed class AvaloniaUiDispatcher : IUiDispatcher
|
||||
{
|
||||
public void Post(Action action)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(action);
|
||||
Dispatcher.UIThread.Post(action);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ImmediateUiDispatcher : IUiDispatcher
|
||||
{
|
||||
public void Post(Action action)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(action);
|
||||
action();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue