Поделиться через


MediaElement.Volume Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the media's volume.

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

Syntax

'Declaration
Public Property Volume As Double
public double Volume { get; set; }
<MediaElement Volume="double"/>

Property Value

Type: System.Double
The media's volume represented on a linear scale between 0 and 1. The default is 0.5.

Remarks

Dependency property identifier field: VolumeProperty

Volume can be difficult to quantify because each media file has a different baseline for its recorded or perceived audio level. Also, true audio volume as represented on the decibel scale is inherently logarithmic. You can think of the Volume property as representing the position value of an audio mixer slider control, with 0 being all the way down and 1 being all the way up.

Platform Notes

Silverlight for Windows Phone Silverlight for Windows Phone

 The default volume on Silverlight for Windows Phone is 0.85.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

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

Platforms

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