From 72beb30f025bf4b808a0bfd59d7ba603c883dc0f Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 28 Jan 2022 23:04:08 +0100 Subject: [PATCH] Cast to interface instead of concrete type. `PlatformImpl` may be a `ValidatingTopLevelImpl`. --- src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs b/src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs index 435e0671df..8c7dfb5de2 100644 --- a/src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs +++ b/src/Windows/Avalonia.Win32/Automation/RootAutomationNode.cs @@ -2,6 +2,7 @@ using System.Runtime.InteropServices; using Avalonia.Automation.Peers; using Avalonia.Automation.Provider; +using Avalonia.Platform; using Avalonia.Win32.Interop.Automation; #nullable enable @@ -21,7 +22,7 @@ namespace Avalonia.Win32.Automation public override IRawElementProviderFragmentRoot? FragmentRoot => this; public new IRootProvider Peer { get; } - public WindowImpl? WindowImpl => Peer.PlatformImpl as WindowImpl; + public IWindowImpl? WindowImpl => Peer.PlatformImpl as IWindowImpl; public IRawElementProviderFragment? ElementProviderFromPoint(double x, double y) {