Windows apps
Collapse the table of content
Expand the table of content
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.

MediaLibraryExtensions.Delete Method

Deletes the specified song from the specified MediaLibrary, after prompting for confirmation.

public static void Delete (
         MediaLibrary library,
         Song song


Type: MediaLibrary
The media library from which the song is to be deleted.
Type: Song
The song to be deleted.

The deletion performed by this method cascades to related items. For example, if the deleted song was the last song for an album or artist, then the related album or artist is also deleted.

Capabilities for Windows Phone

If you use this API in your Windows Phone app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.

ID_CAP_MEDIALIB_AUDIOWindows Phone 8, Windows Phone OS 7.1

For more info, see App capabilities and hardware requirements for Windows Phone.

Namespace: Microsoft.Xna.Framework.Media.PhoneExtensions
Assembly: Microsoft.Xna.Framework.Media.PhoneExtensions (in

Windows Phone

Community Additions

© 2017 Microsoft