Skip to content

UIServiceCollectionExtensions.AddUICanvas(this IServiceCollection) Method

Definition

Namespace: Brine2D.UI

Adds UICanvas to the service collection. Kept for backward compatibility; UICanvas is now registered by default via AddBrine2D(), so calling this is only necessary when AddBrine2D() was not used. Uses IServiceCollectionServiceExtensions.TryAddScoped<TService>\(IServiceCollection, Func<IServiceProvider, TService>\) so it never overrides an existing registration. Window-resize tracking is NOT automatic — opt in explicitly via AutoResizeToWindow.

C#
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddUICanvas(this Microsoft.Extensions.DependencyInjection.IServiceCollection services);

Parameters

services Microsoft.Extensions.DependencyInjection.IServiceCollection

Returns

Microsoft.Extensions.DependencyInjection.IServiceCollection