2024-02-21 02:17:33 +01:00
|
|
|
using InkForge.Data;
|
2024-02-16 02:23:58 +01:00
|
|
|
using InkForge.Desktop.Data;
|
2024-02-21 02:17:33 +01:00
|
|
|
using InkForge.Desktop.Data.Options;
|
|
|
|
|
using InkForge.Desktop.Managers;
|
|
|
|
|
using InkForge.Desktop.Models;
|
2024-02-16 02:23:58 +01:00
|
|
|
using InkForge.Desktop.ViewModels;
|
2024-02-09 01:23:38 +01:00
|
|
|
|
2024-02-16 02:23:58 +01:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
2024-02-09 13:02:20 +01:00
|
|
|
using ReactiveUI;
|
|
|
|
|
|
2024-02-10 23:47:45 +01:00
|
|
|
using Splat;
|
|
|
|
|
|
2024-02-09 01:23:38 +01:00
|
|
|
namespace Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
public static class InkForgeServiceCollections
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection AddInkForge(this IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
services.AddHttpClient();
|
|
|
|
|
|
2024-02-21 02:17:33 +01:00
|
|
|
services.AddScoped<IWorkspaceAccessor, WorkspaceAccessor>();
|
2024-02-16 02:23:58 +01:00
|
|
|
services.AddScoped<IDbContextFactory<NoteDbContext>, NoteDbContextFactory>();
|
|
|
|
|
|
2024-02-21 02:17:33 +01:00
|
|
|
services.AddScoped<LocalWorkspaceOptions>();
|
2024-02-09 01:23:38 +01:00
|
|
|
|
2024-02-10 10:38:28 +01:00
|
|
|
services.AddSingleton<LandingViewModel>();
|
2024-02-21 02:17:33 +01:00
|
|
|
services.AddSingleton<WorkspaceManager>();
|
2024-02-09 01:23:38 +01:00
|
|
|
|
2024-02-10 23:47:45 +01:00
|
|
|
Locator.CurrentMutable.RegisterViewsForViewModels(typeof(InkForgeServiceCollections).Assembly);
|
2024-02-09 13:02:20 +01:00
|
|
|
|
2024-02-09 01:23:38 +01:00
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|