From e5cdf3c4b4b4064ebb3e26419e430837f01992bc Mon Sep 17 00:00:00 2001 From: Max Katz Date: Sun, 3 Nov 2024 12:50:24 +0000 Subject: [PATCH] Implement TryGetFeature on secondary previewer windows (#17409) --- 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 de8f0749e1..e3117ab8b2 100644 --- a/src/Avalonia.DesignerSupport/Remote/Stubs.cs +++ b/src/Avalonia.DesignerSupport/Remote/Stubs.cs @@ -197,7 +197,20 @@ namespace Avalonia.DesignerSupport.Remote 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() { } }