add a central cache, for easy data retriveal
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using CommunityToolkit.WinUI;
|
||||
using Microsoft.UI.Dispatching;
|
||||
|
||||
namespace Hyperbar.Windows;
|
||||
|
||||
public class Dispatcher :
|
||||
IDispatcher
|
||||
{
|
||||
private DispatcherQueue dispatcherQueue;
|
||||
|
||||
public Dispatcher() => dispatcherQueue = DispatcherQueue.GetForCurrentThread();
|
||||
|
||||
public async Task InvokeAsync(Action action) => await dispatcherQueue.EnqueueAsync(action.Invoke);
|
||||
}
|
||||
@@ -34,8 +34,10 @@ namespace Hyperbar.Windows
|
||||
isolatedServices.AddHostedService<WidgetService>();
|
||||
|
||||
isolatedServices.AddTransient<ITemplateFactory, TemplateFactory>();
|
||||
|
||||
isolatedServices.AddScoped<IMediator, Mediator>();
|
||||
isolatedServices.AddScoped<IDisposer, Disposer>();
|
||||
isolatedServices.AddSingleton<IDispatcher, Dispatcher>();
|
||||
|
||||
isolatedServices.AddScoped<IVirtualKeyboard, VirtualKeyboard>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user