Share via


CompositionTarget.SurfaceContentsLost 事件

定义

发生基础重大更改(例如 DirectX 设备更改)时发生。 通常,当收到此事件的通知时,应用程序必须重新生成其表面内容。

// Register
static event_token SurfaceContentsLost(EventHandler<IInspectable> const& handler) const;

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

// Revoke with event_revoker
static CompositionTarget::SurfaceContentsLost_revoker SurfaceContentsLost(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
public static event System.EventHandler<object> SurfaceContentsLost;
function onSurfaceContentsLost(eventArgs) { /* Your code */ }
Windows.UI.Xaml.Media.CompositionTarget.addEventListener("surfacecontentslost", onSurfaceContentsLost);
Windows.UI.Xaml.Media.CompositionTarget.removeEventListener("surfacecontentslost", onSurfaceContentsLost);
- or -
Windows.UI.Xaml.Media.CompositionTarget.onsurfacecontentslost = onSurfaceContentsLost;
Public Shared Custom Event SurfaceContentsLost As EventHandler(Of Object) 

事件类型

适用于