diff --git a/src/AvaloniaEdit/Utils/IServiceContainer.cs b/src/AvaloniaEdit/Utils/IServiceContainer.cs index fa88b3fa..3523d9c3 100644 --- a/src/AvaloniaEdit/Utils/IServiceContainer.cs +++ b/src/AvaloniaEdit/Utils/IServiceContainer.cs @@ -36,6 +36,12 @@ internal class ServiceContainer : IServiceContainer { private readonly Dictionary _services = new Dictionary(); + public ServiceContainer() + { + _services.Add(typeof(IServiceProvider), this); + _services.Add(typeof(IServiceContainer), this); + } + public object GetService(Type serviceType) { _services.TryGetValue(serviceType, out var service);