Share via


BrightnessOverride.GetDefaultForSystem Method

Definition

Returns a brightness override object. This method does not require CoreWindow so it can be used by apps that are running in the background.

public:
 static BrightnessOverride ^ GetDefaultForSystem();
 static BrightnessOverride GetDefaultForSystem();
public static BrightnessOverride GetDefaultForSystem();
function getDefaultForSystem()
Public Shared Function GetDefaultForSystem () As BrightnessOverride

Returns

The brightness override object.

Examples

This example overrides the device's brightness at full brightness, but is used by apps that run in the background and do not have a CoreWindow.

private void Set_Full_Brightness_AppsInBackground()
{
    //Create BrightnessOverride object
    BrightnessOverride bo = BrightnessOverride.GetDefaultForSystem();

    //Set override brightness to full brightness even when battery is low
    bo.SetBrightnessScenario(DisplayBrightnessScenario.FullBrightness, DisplayBrightnessOverrideOptions.None);

    //Request to start the overriding process
    bo.StartOverride();
}

Remarks

Requires the systemManagement capability to be declared in your app's package manifest. Usage of the systemManagement capability requires Embedded mode to be enabled. This capability allows apps to have basic system administration privileges. If it isn’t declared, this method throws an access is denied exception. For more info, see App capability declarations.

Applies to