Class Display
Definition
- Assembly:
- Tizen.System.dll
The Display class provides the properties and events to control the display status and brightness.
public class Display
- Inheritance
-
objectDisplay
Remarks
The Display API provides the way to get the current display brightness value, the display state, and the total number of available displays. It also provides the events for an application to receive the display state change events from the device. To receive the display event, the application should register with an associated EventHandler.
Examples
Console.WriteLine("Display current state is: {0}", Tizen.System.Display.State);
Console.WriteLine("Total number of Displays are: {0}", Tizen.System.Display.NumberOfDisplays);
Properties
View SourceBrightness
The brightness value of the specific display device.
Declaration
public int Brightness { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
The brightness value should be less than or equal to the MaxBrightness value.
Examples
Display display = Display.Displays[0];
Console.WriteLine("Display current Brightness is: {0}", display.Brightness);
Exceptions
Type | Condition |
---|---|
System.ArgumentException | When an invalid parameter value is set. |
System.UnauthorizedAccessException | If the privilege is not set. |
System.InvalidOperationException | In case of any system error. |
System.NotSupportedException | This exception can be due to device not supported. |
See Also
View SourceDisplays
Gets all the available displays. The display at the index zero is always assigned to the main display.
Declaration
public static IReadOnlyList<Display> Displays { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<T><Display> |
Remarks
The Display API provides the way to get the current display brightness value, the display state, and the total number of available displays. It also provides the events for an application to receive the display state change events from the device. To receive the display event, the application should register with an associated EventHandler.
MaxBrightness
The maximum brightness value that can be set for the specific display.
Declaration
public int MaxBrightness { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Retrieves the maximum brightness level of a specific display device.
Examples
Display display = Display.Displays[0];
Console.WriteLine("Display MaxBrightness is: {0}", display.MaxBrightness);
View Source
NumberOfDisplays
The number of available display devices connected to current device.
Declaration
public static int NumberOfDisplays { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Retrieves the number of display devices connected to the system.
Examples
using Tizen.System;
...
Console.WriteLine("Total number of Displays are: {0}", Display.NumberOfDisplays);
See Also
View SourceState
The current device display state, including normal, dim, and off states.
Declaration
public static DisplayState State { get; set; }
Property Value
Type | Description |
---|---|
DisplayState |
Remarks
When the display state is set, it should be checked the profile version and supported display state.
Examples
using Tizen.System;
...
DisplayState current = Display.State;
Console.WriteLine("Display current state is: {0}", current);
...
Display.State = DisplayState.Normal;
...
See Also
Events
View SourceStateChanged
StateChanged is raised when the state of the display is changed.
Declaration
public static event EventHandler<DisplayStateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><DisplayStateChangedEventArgs> |
Remarks
The Display API provides the way to get the current display brightness value, the display state, and the total number of available displays. It also provides the events for an application to receive the display state change events from the device. To receive the display event, the application should register with an associated EventHandler.
Examples
public static async Task DisplayEventHandler()
{
EventHandler<DisplayStateChangedEventArgs> handler = null;
handler = (object sender, DisplayStateChangedEventArgs args) =>
{
Console.WriteLine("Display State is: {0}", args.State);
}
Display.StateChanged += handler;
await Task.Delay(20000);
}