From a4ebcf7886ec81867ef9941eb609986f21321e22 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Fri, 1 Nov 2024 22:25:29 -0700 Subject: [PATCH] Implement TryGetFeature on secondary previewer windows --- src/Avalonia.DesignerSupport/Remote/Stubs.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.DesignerSupport/Remote/Stubs.cs b/src/Avalonia.DesignerSupport/Remote/Stubs.cs index de8f0749e17..e3117ab8b2a 100644 --- a/src/Avalonia.DesignerSupport/Remote/Stubs.cs +++ b/src/Avalonia.DesignerSupport/Remote/Stubs.cs @@ -197,7 +197,20 @@ public void SetWindowManagerAddShadowHint(bool enabled) public void SetFrameThemeVariant(PlatformThemeVariant themeVariant) { } public AcrylicPlatformCompensationLevels AcrylicCompensationLevels { get; } = new AcrylicPlatformCompensationLevels(1, 1, 1); - public object TryGetFeature(Type featureType) => null; + public object TryGetFeature(Type featureType) + { + if (featureType == typeof(IStorageProvider)) + { + return new NoopStorageProvider(); + } + + if (featureType == typeof(IScreenImpl)) + { + return new ScreenStub(); + } + + return null; + } public void TakeFocus() { } }