Skip to content

Commit

Permalink
Implement TryGetFeature on secondary previewer windows (#17409)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkatz6 authored Nov 3, 2024
1 parent 93f8227 commit cbbd45c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Avalonia.DesignerSupport/Remote/Stubs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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() { }
}

Expand Down

0 comments on commit cbbd45c

Please sign in to comment.