Cleaning up the solution. Separating Shared.WinRT, Services and Synchronization. Removing synchronization from app. Reducing bundle size by 45mb.
This commit is contained in:
20
Wino.Shared.WinRT/WinAppDispatcher.cs
Normal file
20
Wino.Shared.WinRT/WinAppDispatcher.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.WinUI;
|
||||
using Microsoft.UI.Dispatching;
|
||||
using Wino.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Shared.WinRT
|
||||
{
|
||||
public class WinAppDispatcher : IDispatcher
|
||||
{
|
||||
private readonly DispatcherQueue _dispatcherQueue;
|
||||
|
||||
public WinAppDispatcher(DispatcherQueue dispatcherQueue)
|
||||
{
|
||||
_dispatcherQueue = dispatcherQueue;
|
||||
}
|
||||
|
||||
public Task ExecuteOnUIThread(Action action) => _dispatcherQueue.EnqueueAsync(() => { action(); });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user