Export (0) Print
Expand All

MediaElement.CanPause Property

Gets a value indicating if media can be paused if the Pause method is called.

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

public bool CanPause { get; }

Property Value

Type: System.Boolean
true if the media can be paused; otherwise, false. The default is false.

Dependency property identifier field: CanPauseProperty

Streaming media cannot be paused. Therefore CanPause returns false for any case where the MediaElement has loaded streaming media. However, it should not be inferred that any case where CanPause is false always indicates streaming media. This API is intended for determining whether user capabilities are available at a point in time so that your application can present appropriate UI, and is not intended for probing the media itself.

Calling Pause on a MediaElement that has opened and is playing streaming content does not throw an error. Instead the method call is ignored.

One scenario for this property is to check it after MediaOpened is raised, and potentially change the display characteristics of any "Pause" button that appears in UI if CanPause is false.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft