Skip to main content

Screen Class

Definition

Assembly:Avalonia.Controls
Package:Avalonia
Source:Screen.cs

Represents a single display screen.

public class Screen

Inheritance: object -> Screen

Derived types:PlatformScreen

Implements: IEquatable<Screen>

Methods

NameDescription
Equals (2 overloads)No summary available.
GetHashCodeNo summary available.
ToStringNo summary available.
TryGetPlatformHandleTries to get the platform handle for the Screen.

Equals overloads

Equals Method

public bool Equals(Avalonia.Platform.Screen other)
Parameters

other Avalonia.Platform.Screen

Returns

bool

Equals Method

public bool Equals(object obj)
Parameters

obj object

Returns

bool

GetHashCode Method

public int GetHashCode()

Returns

int

ToString Method

public string ToString()

Returns

string

TryGetPlatformHandle Method

Tries to get the platform handle for the Screen.

public Avalonia.Platform.IPlatformHandle TryGetPlatformHandle()

Returns

Avalonia.Platform.IPlatformHandle

An Avalonia.Platform.IPlatformHandle describing the screen handle, or null if the handle could not be retrieved.

Properties

NameDescription
BoundsGets the overall pixel-size and position of the screen.
CurrentOrientationGets the current orientation of a screen.
DisplayNameGets the device name associated with a display.
IsPrimaryGets a value indicating whether the screen is the primary one.
ScalingGets the scaling factor applied to the screen by the operating system.
WorkingAreaGets the actual working-area pixel-size of the screen.

Bounds Property

Gets the overall pixel-size and position of the screen.

public Avalonia.PixelRect Bounds { get; set; }

Remarks

This generally is the raw pixel counts in both the X and Y direction.

CurrentOrientation Property

Gets the current orientation of a screen.

public Avalonia.Platform.ScreenOrientation CurrentOrientation { get; set; }

DisplayName Property

Gets the device name associated with a display.

public string DisplayName { get; set; }

IsPrimary Property

Gets a value indicating whether the screen is the primary one.

public bool IsPrimary { get; set; }

Scaling Property

Gets the scaling factor applied to the screen by the operating system.

public double Scaling { get; set; }

Remarks

Multiply this value by 100 to get a percentage. Both X and Y scaling factors are assumed uniform.

WorkingArea Property

Gets the actual working-area pixel-size of the screen.

public Avalonia.PixelRect WorkingArea { get; set; }

Remarks

This area may be smaller than Bounds to account for notches and other block-out areas such as taskbars etc.