LampArrayCustomEffect.UpdateRequested 事件

定義

由系統觸發的事件,表示應該修改燈光狀態。

// Register
event_token UpdateRequested(TypedEventHandler<LampArrayCustomEffect, LampArrayUpdateRequestedEventArgs const&> const& handler) const;

// Revoke with event_token
void UpdateRequested(event_token const* cookie) const;

// Revoke with event_revoker
LampArrayCustomEffect::UpdateRequested_revoker UpdateRequested(auto_revoke_t, TypedEventHandler<LampArrayCustomEffect, LampArrayUpdateRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<LampArrayCustomEffect,LampArrayUpdateRequestedEventArgs> UpdateRequested;
function onUpdateRequested(eventArgs) { /* Your code */ }
lampArrayCustomEffect.addEventListener("updaterequested", onUpdateRequested);
lampArrayCustomEffect.removeEventListener("updaterequested", onUpdateRequested);
- or -
lampArrayCustomEffect.onupdaterequested = onUpdateRequested;
Public Custom Event UpdateRequested As TypedEventHandler(Of LampArrayCustomEffect, LampArrayUpdateRequestedEventArgs) 

事件類型

範例

LampArray 範例

示範如何使用Windows.Devices.Lights 和 Windows.Devices.Lights.Effects API 來控制周邊裝置的 RGB 光源。

AutoRGB 範例

示範如何從桌面畫面擷取單一代表性色彩,並用它來在連接的 RGB 裝置上亮起 LED 燈。

備註

  • 一旦播放清單啟動效果,它就會立即觸發 UpdateRequested 事件。
  • 如果播放清單暫停效果,它將會暫時停止進一步的事件觸發程式。 會在再次啟動播放清單時繼續。
  • 如果播放清單停止效果,在播放清單再次啟動之前,不會再發生任何事件觸發程式。
  • 事件會在 Duration 到期時觸發最後的時間。 呼叫端應該使用此選項,在效果完成之前設定任何最終狀態。

未定義向這個事件註冊的多個處理常式行為。

適用於

另請參閱