共用方式為


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) 

事件類型

適用於