The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MediaPropertySet.Size | size property

Applies to Windows and Windows Phone

Gets the number of items contained in the property set.


var size = mediaPropertySet.size;

Property value

Type: Number [JavaScript] | uint32 [C++]

The number of items in the property set.


The following example gets an instance of the MediaPropertySet class from the AudioEncodingProperties class and then gets the number of items in the property set. The example also shows how to use the other methods in the MediaPropertySet class.

function getPropertySet() { 
    var encodingProperties = new Windows.Media.MediaProperties.AudioEncodingProperties();
    var props =;
    // Remove all items from the property set.
    // Get an iterator for this property set. 
    var itertator = props.first();
    // Get the immutable view of the property set.
    var view = props.getView();   
    // Determine if the set has an item with the specified key.   
    if (props.hasKey(key)) {
        // Use the item.
    // Add an item with the specified key and value to the property set.    
    if (props.insert(key, value)) {
        // Value was replaced.
    else {
        // New key and value.
    // Get the value for the specified key.
    var value = props.lookup(key);
    // Remove the item with the specified key from the property set.
    // Get the number of items in the property set.
    var number = props.size;


Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::Media::MediaProperties [C++]



See also




© 2014 Microsoft. All rights reserved.