I am trying to insert a feature into my windows phone 7 application in the way that upon a click of a button it开发者_StackOverflow社区 will lanuch something like the photo chooser task where the user can choose the images in the mobile phone.
Is there a way that i can allow the user to choose the song in the mobile phone?
Anyone can help me with it?? Thanks..
There is no built in chooser for this but you could get a list of songs to display using the MediaLibrary.Songs property and then creating your own UI.
Update
Here's how:
Add a reference in your project to Microsoft.Xna.Framework
. (Yes, even in a Silverlight app)
The use it like this:
using Microsoft.Xna.Framework.Media;
using (var ml = new MediaLibrary())
{
foreach (var song in ml.Songs)
{
System.Diagnostics.Debug.WriteLine(song.Artist + " " + song.Name);
}
}
You probably want to do someting more useful than write to debug out but hopefully this shows you how to get started.
精彩评论