diff --git a/src/Avalonia.Controls/Screens.cs b/src/Avalonia.Controls/Screens.cs index a9f52315f9..60d5358c49 100644 --- a/src/Avalonia.Controls/Screens.cs +++ b/src/Avalonia.Controls/Screens.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using Avalonia.Platform; @@ -37,11 +37,22 @@ namespace Avalonia.Controls _iScreenImpl = iScreenImpl; } + /// + /// Retrieves a Screen for the display that contains the rectangle. + /// + /// Bounds that specifies the area for which to retrieve the display. + /// The . public Screen? ScreenFromBounds(PixelRect bounds) { return _iScreenImpl.ScreenFromRect(bounds); } + /// + /// Retrieves a Screen for the display that contains the specified . + /// + /// The window for which to retrieve the Screen. + /// Window platform implementation was already disposed. + /// The . public Screen? ScreenFromWindow(WindowBase window) { if (window.PlatformImpl is null) @@ -52,17 +63,32 @@ namespace Avalonia.Controls return _iScreenImpl.ScreenFromWindow(window.PlatformImpl); } + /// + /// Retrieves a Screen for the display that contains the specified . + /// + /// The window impl for which to retrieve the Screen. + /// The . [Obsolete("Use ScreenFromWindow(WindowBase) overload.")] public Screen? ScreenFromWindow(IWindowBaseImpl window) { return _iScreenImpl.ScreenFromWindow(window); } + /// + /// Retrieves a Screen for the display that contains the specified point. + /// + /// A Point that specifies the location for which to retrieve a Screen. + /// The . public Screen? ScreenFromPoint(PixelPoint point) { return _iScreenImpl.ScreenFromPoint(point); } + /// + /// Retrieves a Screen for the display that contains the specified . + /// + /// A Visual for which to retrieve a Screen. + /// The . public Screen? ScreenFromVisual(Visual visual) { var tl = visual.PointToScreen(visual.Bounds.TopLeft);