DisplayPropertiesEventHandler 代理人

定義

注意

DisplayProperties 型と関連するイベント ハンドラーは、Windows 8.1後のリリースで変更または使用できない場合があります。 代わりに、 DisplayInformation を使用します。

表示プロパティ イベントを処理するメソッドを表します。

public delegate void DisplayPropertiesEventHandler(Platform::Object ^ sender);
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("DisplayProperties may be altered or unavailable for releases after Windows Phone 8.1. Instead, use DisplayInformation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Guid(3688729345, 61857, 18129, 158, 227, 84, 59, 204, 153, 89, 128)]
class DisplayPropertiesEventHandler : MulticastDelegate
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(3688729345, 61857, 18129, 158, 227, 84, 59, 204, 153, 89, 128)]
/// [Windows.Foundation.Metadata.Deprecated("DisplayProperties may be altered or unavailable for releases after Windows Phone 8.1. Instead, use DisplayInformation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
class DisplayPropertiesEventHandler : MulticastDelegate
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("DisplayProperties may be altered or unavailable for releases after Windows Phone 8.1. Instead, use DisplayInformation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Guid(3688729345, 61857, 18129, 158, 227, 84, 59, 204, 153, 89, 128)]
public delegate void DisplayPropertiesEventHandler(object sender);
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(3688729345, 61857, 18129, 158, 227, 84, 59, 204, 153, 89, 128)]
[Windows.Foundation.Metadata.Deprecated("DisplayProperties may be altered or unavailable for releases after Windows Phone 8.1. Instead, use DisplayInformation.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public delegate void DisplayPropertiesEventHandler(object sender);
var displayPropertiesEventHandlerHandler = function(sender){
/* Your code */
}
Public Delegate Sub DisplayPropertiesEventHandler(sender As Object)

パラメーター

sender
Object

Platform::Object

IInspectable

イベントを発生させたオブジェクト。

属性

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

#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();
}

注釈

アプリケーションでは、ほとんどの表示イベントを処理するために 1 つのデリゲートを使用することをお勧めします。ほとんどの場合、各表示プロパティを変更するには、アプリケーション自体を再描画する必要があるためです。 また、多くのプロパティ変更は、オペレーティング システム全体に影響を与える単一モードの変更によって発生します。

Direct3D 11.1 Simple Stereo 3D サンプルは、システム ステレオの変更を処理する方法を示しています。

適用対象