Class Display
Definition
- Namespace:
- Tizen.System
- Assembly:
- Tizen.System.dll
- API Level:
- 3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/display
The Display class provides the properties and events to control the display status and brightness.
C#Copypublic class Display
- Inheritance
-
System.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
CopyConsole.WriteLine("Display current state is: {0}", Tizen.System.Display.State); Console.WriteLine("Total number of Displays are: {0}", Tizen.System.Display.NumberOfDisplays);
Properties
Declaration
C#Copypublic int Brightness { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The brightness value should be less than or equal to the MaxBrightness value.
Examples
CopyDisplay 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. |
UnauthorizedAccessException | If the privilege is not set. |
API Level: 3
View Source
Displays
Gets all the available displays. The display at the index zero is always assigned to the main display.
Declaration
C#Copypublic static IReadOnlyList<Display> Displays { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<Display> |
API Level: 3
Declaration
C#Copypublic int MaxBrightness { get; }
Property Value
Type | Description |
---|---|
Int32 |
Examples
CopyDisplay display = Display.Displays[0]; Console.WriteLine("Display MaxBrightness is: {0}", display.MaxBrightness);
API Level: 3
Declaration
C#Copypublic static int NumberOfDisplays { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: 3
Declaration
C#Copypublic static DisplayState State { get; set; }
Property Value
Type | Description |
---|---|
DisplayState |
API Level: 3
Events
Declaration
C#Copypublic static event EventHandler<DisplayStateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<DisplayStateChangedEventArgs> |
Examples
Copypublic static async Task DisplayEventHandler() { EventHandler<DisplayStateChangedEventArgs> handler = null; handler = (object sender, DisplayStateChangedEventArgs args) => { Console.WriteLine("Display State is: {0}", args.State); } Battery.StateChanged += handler; await Task.Delay(20000); }