Occurs when the value of the CurrentState property changes.
| XAML | <object CurrentStateChanged="eventhandlerFunction" .../> |
| Scripting |
[token = ]object.AddEventListener("CurrentStateChanged", eventhandlerFunction)
|
AddEventListener Parameters
| token | integer A token that is returned from the function, which you can optionally retain as a variable. If you intend to call RemoveEventListener to remove the handler, you will need this token. |
| eventhandlerFunction | object The name of your event handler function as it is defined in script. When used as an AddEventListener parameter, quotes around the function name are not required. See Remarks. |
Event Handler Parameters
| sender | object Identifies the object that invoked the event. |
| eventArgs | object This parameter is always set to null. |
Examples
The following example demonstrates one way to display the
CurrentState of a MediaElement.
It creates a MediaElement and several buttons for controlling
media playback. To display the current state of the MediaElement, the
example registers for the CurrentStateChanged event
and uses an event handler to update a TextBlock.
Applies To
MediaElement
See Also
Silverlight Events
Media Overview
MediaElement States