DisplayProperties.OrientationChanged 事件

定义

注意

displayProperties 在Windows 8.1后可能会更改或不可用于发布。 请改用 DisplayInformation

CurrentOrientationNativeOrientation 属性因模式更改或监视器更改而更改时发生。

public:
 static event DisplayPropertiesEventHandler ^ OrientationChanged;
/// [add: 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)]
/// [remove: 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)]
// Register
static event_token OrientationChanged(DisplayPropertiesEventHandler const& handler) const;

// Revoke with event_token
static void OrientationChanged(event_token const* cookie) const;

// Revoke with event_revoker
static DisplayProperties::OrientationChanged_revoker OrientationChanged(auto_revoke_t, DisplayPropertiesEventHandler const& handler) const;
/// [add: 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")]
/// [remove: 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")]
// Register
static event_token OrientationChanged(DisplayPropertiesEventHandler const& handler) const;

// Revoke with event_token
static void OrientationChanged(event_token const* cookie) const;

// Revoke with event_revoker
static DisplayProperties::OrientationChanged_revoker OrientationChanged(auto_revoke_t, DisplayPropertiesEventHandler const& handler) const;
[add: 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))]
[remove: 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))]
public static event DisplayPropertiesEventHandler OrientationChanged;
[add: 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")]
[remove: 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 static event DisplayPropertiesEventHandler OrientationChanged;
function onOrientationChanged(eventArgs) { /* Your code */ }
Windows.Graphics.Display.DisplayProperties.addEventListener("orientationchanged", onOrientationChanged);
Windows.Graphics.Display.DisplayProperties.removeEventListener("orientationchanged", onOrientationChanged);
- or -
Windows.Graphics.Display.DisplayProperties.onorientationchanged = onOrientationChanged;
Public Shared Custom Event OrientationChanged As DisplayPropertiesEventHandler 

事件类型

属性

适用于