From f51929fe21bf16d26e7ddae89feec6f7b4d2e397 Mon Sep 17 00:00:00 2001 From: Denis Proshutinskii Date: Thu, 6 Apr 2023 14:19:29 +0700 Subject: [PATCH] Expose IServiceContainer --- src/AvaloniaEdit/Utils/IServiceContainer.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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);