-api-id | -api-type |
---|---|
P:Windows.UI.Xaml.Controls.MediaElement.CurrentState |
winrt property |
Gets the status of this MediaElement.
The current state of this MediaElement. The state can be one of the following (as defined in the MediaElementState enumeration): Buffering, Closed, Opening, Paused, Playing, or Stopped. The default value is Closed.
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.
[!code-xamlmedia_ovw_controlling_media_with_currentstate]
[!code-csharpmedia_ovw_controlling_media_with_currentstate_code]
[!code-vbmedia_ovw_controlling_media_with_currentstate_code]