-api-id | -api-type |
---|---|
T:Windows.Graphics.Display.DisplayPropertiesEventHandler |
winrt delegate |
Note
The DisplayProperties type and related event handlers may be altered or unavailable for releases after Windows 8.1. Instead, use DisplayInformation.
Represents a method that handles display property events.
The object that raised the event.
We recommend that applications use a single delegate to handle most display events because in most cases the change to each display property requires that the application redraw itself. Also, many property changes result from a single mode change that affects the entire operating system.
The Direct3D 11.1 Simple Stereo 3D Sample shows how to handle system stereo changes.
#include <winrt/Windows.Graphics.Display.h>
using namespace winrt;
using namespace Windows::Graphics::Display;
...
void GameRenderer::Initialize()
{
DisplayProperties::StereoEnabledChanged({ this, &GameRenderer::OnStereoEnableChanged });
}
void GameRenderer::OnStereoEnableChanged(winrt::Windows::Foundation::IInspectable const& sender)
{
UpdateForStereoChange();
}
void GameRenderer::Initialize()
{
DisplayProperties::StereoEnabledChanged +=
ref new DisplayPropertiesEventHandler(this, &GameRenderer::OnStereoEnableChanged);
}
void GameRenderer::OnStereoEnableChanged(_In_ Platform::Object^ sender)
{
UpdateForStereoChange();
}