Class Screens
Represents all screens available on a device.
public class Screens
- Inheritance
-
Screens
- Inherited Members
Constructors
Screens(IScreenImpl)
Initializes a new instance of the Screens class.
[PrivateApi]
public Screens(IScreenImpl iScreenImpl)
Parameters
iScreenImpl
IScreenImpl
Properties
All
Gets the list of all screens available on the device.
public IReadOnlyList<Screen> All { get; }
Property Value
Primary
Gets the primary screen on the device.
public Screen? Primary { get; }
Property Value
ScreenCount
Gets the total number of screens available on the device.
public int ScreenCount { get; }
Property Value
Methods
RequestScreenDetails()
Asks underlying platform to provide detailed screen information. On some platforms it might include non-primary screens, as well as display names.
public Task<bool> RequestScreenDetails()
Returns
- 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(PixelRect)
Retrieves a Screen for the display that contains the rectangle.
public Screen? ScreenFromBounds(PixelRect bounds)
Parameters
bounds
PixelRectBounds that specifies the area for which to retrieve the display.
Returns
Remarks
On mobile, this method always returns null.
ScreenFromPoint(PixelPoint)
Retrieves a Screen for the display that contains the specified point.
public Screen? ScreenFromPoint(PixelPoint point)
Parameters
point
PixelPointA Point that specifies the location for which to retrieve a Screen.
Returns
Remarks
On mobile, this method always returns null.
ScreenFromTopLevel(TopLevel)
Retrieves a Screen for the display that contains the specified TopLevel.
public Screen? ScreenFromTopLevel(TopLevel topLevel)
Parameters
topLevel
TopLevelThe top level for which to retrieve the Screen.
Returns
Exceptions
- ObjectDisposedException
TopLevel platform implementation was already disposed.
ScreenFromVisual(Visual)
Retrieves a Screen for the display that contains the specified Visual.
public Screen? ScreenFromVisual(Visual visual)
Parameters
visual
VisualA Visual for which to retrieve a Screen.
Returns
ScreenFromWindow(WindowBase)
Retrieves a Screen for the display that contains the specified WindowBase.
public Screen? ScreenFromWindow(WindowBase window)
Parameters
window
WindowBaseThe window for which to retrieve the Screen.
Returns
Exceptions
- ObjectDisposedException
Window platform implementation was already disposed.
Events
Changed
Event raised when any screen was changed.
public event EventHandler? Changed