MediaElement.MarkerReached MediaElement.MarkerReached MediaElement.MarkerReached MediaElement.MarkerReached Event

Definition

Occurs when a timeline marker is encountered during media playback.

public : event TimelineMarkerRoutedEventHandler MarkerReached
// Register
event_token MarkerReached(TimelineMarkerRoutedEventHandler const& handler) const;

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

// Revoke with event_revoker
MarkerReached_revoker MarkerReached(auto_revoke_t, TimelineMarkerRoutedEventHandler const& handler) const;
public event TimelineMarkerRoutedEventHandler MarkerReached
Public Event MarkerReached As TimelineMarkerRoutedEventHandler
<MediaElement MarkerReached="eventhandler"/>

Examples

The following example creates a MediaElement object and responds to its MarkerReached event. Each time a timeline marker is reached, the example displays the timeline marker's Time, Type, and Text values.

<MediaElement Name="Media" Source="video.mp4" MarkerReached="Media_MarkerReached" />
<TextBlock Name="txOutput" />
private void Media_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e)
{
    txOutput.Text =
        string.Format("{0},{1},{2}", e.Marker.Time, e.Marker.Text, e.Marker.Type);
}