Catalog Lite
This commit is contained in:
parent
398cfa310e
commit
181229aa41
18 changed files with 1435 additions and 0 deletions
45
CatalogLite/Program.cs
Normal file
45
CatalogLite/Program.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using Avalonia;
|
||||
using MaddoShared;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace CatalogLite;
|
||||
|
||||
internal static class Program
|
||||
{
|
||||
public static IServiceProvider ServiceProvider { get; private set; } = default!;
|
||||
|
||||
[STAThread]
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
ConfigureServices(services);
|
||||
ServiceProvider = services.BuildServiceProvider();
|
||||
|
||||
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args ?? []);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>()
|
||||
.UsePlatformDetect()
|
||||
.LogToTrace();
|
||||
|
||||
private static void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<PicSettings>();
|
||||
services.AddSingleton<CatalogConfigurationLoader>();
|
||||
services.AddTransient<ImageCreatorImageSharp>();
|
||||
services.AddTransient<IImageCreator>(sp => sp.GetRequiredService<ImageCreatorImageSharp>());
|
||||
services.AddTransient<ImageCreationService>();
|
||||
services.AddTransient<ImageProcessingCoordinator>();
|
||||
services.AddTransient<LiteCatalogViewModel>();
|
||||
services.AddTransient<MainWindow>();
|
||||
|
||||
services.AddLogging(builder =>
|
||||
{
|
||||
builder.AddConsole();
|
||||
builder.SetMinimumLevel(LogLevel.Information);
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue