From 4d67f3230cc58d182ff687a4eec855da57fe078c Mon Sep 17 00:00:00 2001 From: FitDev Date: Mon, 22 May 2023 11:21:28 +0300 Subject: [PATCH] Move TryGetPlatformHandle to TopLevel --- src/Avalonia.Controls/TopLevel.cs | 18 ++++++++++++++++++ src/Avalonia.Controls/WindowBase.cs | 8 -------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs index 67847f621b..d3733e3da5 100644 --- a/src/Avalonia.Controls/TopLevel.cs +++ b/src/Avalonia.Controls/TopLevel.cs @@ -376,6 +376,24 @@ namespace Avalonia.Controls /// public ITopLevelImpl? PlatformImpl { get; private set; } + /// + /// Trys to get the platform handle for the TopLevel-derived control. + /// + /// + /// An describing the window handle, or null if the handle + /// could not be retrieved. + /// + public IPlatformHandle? TryGetPlatformHandle() => PlatformImpl?.Handle; + + /// + /// Trys to get the platform handle for the TopLevel-derived control. + /// + /// + /// An describing the window handle, or null if the handle + /// could not be retrieved. + /// + public IPlatformHandle? TryGetPlatformHandle() => PlatformImpl?.Handle; + /// /// Gets the renderer for the window. /// diff --git a/src/Avalonia.Controls/WindowBase.cs b/src/Avalonia.Controls/WindowBase.cs index b19ad49820..0fad02d72b 100644 --- a/src/Avalonia.Controls/WindowBase.cs +++ b/src/Avalonia.Controls/WindowBase.cs @@ -178,14 +178,6 @@ namespace Avalonia.Controls } } - /// - /// Trys to get the platform handle for the window. - /// - /// - /// An describing the window handle, or null if the handle - /// could not be retrieved. - /// - public IPlatformHandle? TryGetPlatformHandle() => PlatformImpl?.Handle; /// /// Ensures that the window is initialized.