Screens Class
Definition
Represents all screens available on a device.
public class Screens
Methods
| Name | Description |
|---|---|
| RequestScreenDetails | Asks underlying platform to provide detailed screen information. On some platforms it might include non-primary screens, as well as display names. |
| ScreenFromBounds | Retrieves a Screen for the display that contains the rectangle. |
| ScreenFromPoint | Retrieves a Screen for the display that contains the specified point. |
| ScreenFromTopLevel | Retrieves a Screen for the display that contains the specified Avalonia.Controls.TopLevel. |
| ScreenFromVisual | Retrieves a Screen for the display that contains the specified Avalonia.Visual. |
| ScreenFromWindow | Retrieves a Screen for the display that contains the specified Avalonia.Controls.WindowBase. |
RequestScreenDetails Method
Asks underlying platform to provide detailed screen information. On some platforms it might include non-primary screens, as well as display names.
public System.Threading.Tasks.Task<bool> RequestScreenDetails()
Returns
System.Threading.Tasks.Task<bool>
True, if detailed screen information was provided. False, if denied by the platform or user.
Remarks
This method is async and might show a dialog to the user asking for a permission.
ScreenFromBounds Method
Retrieves a Screen for the display that contains the rectangle.
public Avalonia.Platform.Screen ScreenFromBounds(Avalonia.PixelRect bounds)
Parameters
bounds Avalonia.PixelRect
Bounds that specifies the area for which to retrieve the display.
Returns
Remarks
On mobile, this method always returns null.
ScreenFromPoint Method
Retrieves a Screen for the display that contains the specified point.
public Avalonia.Platform.Screen ScreenFromPoint(Avalonia.PixelPoint point)
Parameters
point Avalonia.PixelPoint
A Point that specifies the location for which to retrieve a Screen.