-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
38 lines (32 loc) · 1.06 KB
/
Program.cs
File metadata and controls
38 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Avalonia;
using Microsoft.Extensions.DependencyInjection;
using System;
using TSP.Config;
using TSP.Services;
using TSP.ViewModels;
using TSP.Views;
namespace TSP
{
internal sealed class Program
{
public static IServiceProvider Services { get; private set; }
[STAThread]
public static void Main(string[] args)
{
var services = new ServiceCollection();
services.AddSingleton<PathCostService>();
services.AddSingleton<TwoOptService>();
services.AddSingleton<BruteForceService>();
services.AddSingleton<NearestNeighbourService>();
services.AddTransient<MainWindowViewModel>();
services.AddTransient<MainWindow>();
Services = services.BuildServiceProvider();
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.LogToTrace();
}
}