SystemMediaTransportControls.ButtonPressed SystemMediaTransportControls.ButtonPressed SystemMediaTransportControls.ButtonPressed SystemMediaTransportControls.ButtonPressed SystemMediaTransportControls.ButtonPressed Event

Definition

Occurs when a button is pressed on the SystemMediaTransportControls.

public : event TypedEventHandler<SystemMediaTransportControls, SystemMediaTransportControlsButtonPressedEventArgs> ButtonPressed
// Register
event_token ButtonPressed(TypedEventHandler<SystemMediaTransportControls, SystemMediaTransportControlsButtonPressedEventArgs> const& handler) const;

// Revoke with event_token
void ButtonPressed(event_token const& cookie) const;

// Revoke with event_revoker
ButtonPressed_revoker ButtonPressed(auto_revoke_t, TypedEventHandler<SystemMediaTransportControls, SystemMediaTransportControlsButtonPressedEventArgs> const& handler) const;
public event TypedEventHandler<SystemMediaTransportControls, SystemMediaTransportControlsButtonPressedEventArgs> ButtonPressed
Public Event ButtonPressed As TypedEventHandler (Of SystemMediaTransportControls, SystemMediaTransportControlsButtonPressedEventArgs)
function onButtonPressed(eventArgs){/* Your code */}


systemMediaTransportControls.addEventListener("buttonpressed", onButtonPressed);
systemMediaTransportControls.removeEventListener("buttonpressed", onButtonPressed);

Remarks

Starting with Windows 10, version 1607, UWP apps that use the MediaPlayer class or AudioGraph class to play media are automatically integrated with the SMTC by default. For some scenarios, you may want to manually control the SMTC. In this case, you should ButtonPressed event to be notified that the user has pressed one of the SMTC buttons. For how-to guidance on manually controlling the SMTC, see Manual control of the System Media Transport Controls.

See also