feat:基础功能实现
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using TodoList.Maui.Services;
|
||||
using TodoList.Maui.Services.Platforms;
|
||||
|
||||
namespace TodoList.Maui;
|
||||
|
||||
public static class MauiProgram
|
||||
{
|
||||
public static MauiApp CreateMauiApp()
|
||||
{
|
||||
var builder = MauiApp.CreateBuilder();
|
||||
builder
|
||||
.UseMauiApp<App>()
|
||||
.ConfigureFonts(fonts =>
|
||||
{
|
||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
||||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
||||
});
|
||||
|
||||
builder.Services.AddSingleton<IHotKeySettingsService, HotKeySettingsService>();
|
||||
builder.Services.AddSingleton<IGlobalHotKeyService>(sp => new NullGlobalHotKeyService());
|
||||
builder.Services.AddSingleton<ISystemTrayService>(sp =>
|
||||
{
|
||||
#if WINDOWS
|
||||
return new NullSystemTrayService();
|
||||
#else
|
||||
return new NullSystemTrayService();
|
||||
#endif
|
||||
});
|
||||
|
||||
#if DEBUG
|
||||
builder.Logging.AddDebug();
|
||||
#endif
|
||||
|
||||
return builder.Build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user