Add Community Toolkit example

This commit is contained in:
John Baughman
2024-06-12 20:51:50 -05:00
parent 0ff8defb8c
commit 12adcf3bf4
8 changed files with 324 additions and 13 deletions

View File

@@ -0,0 +1,25 @@
using Microsoft.Extensions.DependencyInjection;
using Terminal.Gui;
namespace CommunityToolkitExample;
public static class Program
{
public static IServiceProvider Services { get; private set; }
private static void Main (string [] args)
{
Services = ConfigureServices ();
Application.Init ();
Application.Run (Services.GetRequiredService<LoginView> ());
Application.Shutdown ();
}
private static IServiceProvider ConfigureServices ()
{
var services = new ServiceCollection ();
services.AddTransient<LoginView> ();
services.AddTransient<LoginViewModel> ();
return services.BuildServiceProvider ();
}
}