Gets the status of the MediaElement.
| XAML | Cannot be used in XAML. |
| Scripting | value = object.CurrentState |
Property Value
MediaState
The current state of the MediaElement. The state can be one of the following (as defined in the MediaState enumeration): Buffering, Closed, Error, Opening, Paused, Playing, or Stopped.
This property is read-only. The default value is Closed.
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
Media Overview
Supported Media Formats and Protocols
MediaElement States
CurrentStateChanged
MediaElement