Position Property

MediaElement::Position Property

 

Gets or sets the current position of progress through the media's playback time.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
property TimeSpan Position {
	TimeSpan get();
	void set(TimeSpan value);
}

Property Value

Type: System::TimeSpan

The amount of time since the beginning of the media. The default is 00:00:00.

Exception Condition
InvalidOperationException

The Clock property is not null.

Setting this property can enable you to jump to different points in playback (also known as seeking). Not all media types allow seek operations. The MediaFailed event will fire if the media source does not allow seeking.

This property has no effect until after the MediaOpened event has occurred.

This property can be set only when the Clock property is null. When the Clock property is non-null, the timing engine controls media playback behavior.

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft