32 references to Services
Microsoft.Maui (26)
Hosting\Animations\AppHostBuilderExtensions.cs (2)
19 builder.Services.TryAddScoped<ITicker>(svcs => new PlatformTicker()); 21 builder.Services.TryAddScoped<IAnimationManager>(svcs => new AnimationManager(svcs.GetRequiredService<ITicker>()));
Hosting\Dispatching\AppHostBuilderExtensions.cs (5)
14 builder.Services.TryAddSingleton<IDispatcherProvider>(svc => 20 builder.Services.TryAddSingleton<ApplicationDispatcher>((svc) => new ApplicationDispatcher(GetDispatcher(svc, false))); 22 builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IMauiInitializeService, ApplicationDispatcherInitializer>()); 25 builder.Services.TryAddScoped<IDispatcher>((svc) => GetDispatcher(svc, true)); 27 builder.Services.TryAddEnumerable(ServiceDescriptor.Scoped<IMauiInitializeScopedService, DispatcherInitializer>());
Hosting\EssentialsMauiAppBuilderExtensions.cs (2)
89 builder.Services.AddSingleton<EssentialsRegistration>(new EssentialsRegistration(configureDelegate)); 91 builder.Services.TryAddEnumerable(ServiceDescriptor.Transient<IMauiInitializeService, EssentialsInitializer>());
Hosting\Fonts\FontsMauiAppBuilderExtensions.cs (5)
31 builder.Services.TryAddSingleton<IEmbeddedFontLoader>(svc => new EmbeddedFontLoader(svc)); 32 builder.Services.TryAddSingleton<IFontRegistrar>(svc => new FontRegistrar(svc.GetRequiredService<IEmbeddedFontLoader>(), svc)); 33 builder.Services.TryAddSingleton<IFontManager>(svc => new FontManager(svc.GetRequiredService<IFontRegistrar>(), svc)); 36 builder.Services.AddSingleton<FontsRegistration>(new FontsRegistration(configureDelegate)); 38 builder.Services.TryAddEnumerable(ServiceDescriptor.Transient<IMauiInitializeService, FontInitializer>());
Hosting\HandlerMauiAppBuilderExtensions.cs (1)
14 ConfigureMauiHandlers(builder.Services, configureDelegate);
Hosting\ImageSources\ImageSourcesMauiAppBuilderExtensions.cs (3)
28 builder.Services.AddSingleton<ImageSourceRegistration>(new ImageSourceRegistration(configureDelegate)); 31 builder.Services.TryAddSingleton<IImageSourceServiceProvider>(svcs => new ImageSourceServiceProvider(svcs.GetRequiredService<IImageSourceServiceCollection>(), svcs)); 32 builder.Services.TryAddSingleton<IImageSourceServiceCollection>(svcs => new ImageSourceServiceBuilder(svcs.GetServices<ImageSourceRegistration>()));
Hosting\LifecycleEvents\AppHostBuilderExtensions.cs (2)
27 builder.Services.TryAddSingleton<ILifecycleEventService>(sp => new LifecycleEventService(sp.GetServices<LifecycleEventRegistration>())); 30 builder.Services.AddSingleton<LifecycleEventRegistration>(new LifecycleEventRegistration(configureDelegate));
Hosting\MauiAppBuilder.cs (6)
27 Services.AddSingleton<IConfiguration>(sp => configuration.Value); 101 Services.AddLogging(); 102 return new LoggingBuilder(Services); 135 var container = factory.CreateBuilder(Services); 179 Services.TryAdd(ServiceDescriptor.Singleton<ILoggerFactory, NullLoggerFactory>()); 180 Services.TryAdd(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(NullLogger<>)));
Microsoft.Maui.Controls (5)
Hosting\AppHostBuilderExtensions.cs (3)
41 builder.Services.TryAddSingleton<IApplication, TApp>(); 57 builder.Services.TryAddSingleton<IApplication>(implementationFactory); 183 builder.Services.AddScoped(_ => new HideSoftInputOnTappedChangedManager());
Hosting\Effects\AppHostBuilderExtensions.cs (2)
45 builder.Services.TryAddSingleton(svc => new EffectsFactory(svc.GetServices<EffectsRegistration>())); 48 builder.Services.AddSingleton<EffectsRegistration>(new EffectsRegistration(configureDelegate));
Microsoft.Maui.Controls.Compatibility (1)
AppHostBuilderExtensions.cs (1)
117 builder.Services.TryAddEnumerable(ServiceDescriptor.Transient<IMauiInitializeService, MauiCompatInitializer>());