mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
30 lines
872 B
C#
30 lines
872 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Terminal.Gui.Configuration;
|
|
using Terminal.Gui.App;
|
|
using Terminal.Gui.ViewBase;
|
|
|
|
|
|
namespace CommunityToolkitExample;
|
|
|
|
public static class Program
|
|
{
|
|
public static IServiceProvider? Services { get; private set; }
|
|
|
|
private static void Main (string [] args)
|
|
{
|
|
ConfigurationManager.Enable (ConfigLocations.All);
|
|
Services = ConfigureServices ();
|
|
Application.Init ();
|
|
Application.Run (Services.GetRequiredService<LoginView> ());
|
|
Application.TopRunnable?.Dispose ();
|
|
Application.Shutdown ();
|
|
}
|
|
|
|
private static IServiceProvider ConfigureServices ()
|
|
{
|
|
var services = new ServiceCollection ();
|
|
services.AddTransient<LoginView> ();
|
|
services.AddTransient<LoginViewModel> ();
|
|
return services.BuildServiceProvider ();
|
|
}
|
|
} |