Skip to content

FontManager auto-registers itself instead of being registered in Application::RegisterServices #10081

@kekekeks

Description

@kekekeks

We should never use this pattern:

public static FontManager Current
{
get
{
var current = AvaloniaLocator.Current.GetService<FontManager>();
if (current != null)
{
return current;
}
var fontManagerImpl = AvaloniaLocator.Current.GetRequiredService<IFontManagerImpl>();
current = new FontManager(fontManagerImpl);
AvaloniaLocator.CurrentMutable.Bind<FontManager>().ToConstant(current);
return current;
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions