1, why TextBlock when the data binding, set its allowdrop= "True" property will occur exception?
2, the data binding for the ListBox, the mobile phone direction for vertical when the content can be fully displayed, but when the phone landscape display when the content is not fully displayed?
The workaround is to delete the Height property of the listbox.
3. The Medialibrary class can get pictures and music from the Media Library.
medialibrary Library = new Medialibrary ();
4. Questions about Mediaplayer.play (); Methods:
Public partial class Examplepanoramapage1:phoneapplicationpage
{
static Medialibrary lib = new Medialibrary ();
Songcollection sc = lib. Songs;
Public ExamplePanoramaPage1 ()
{
InitializeComponent ();
}
private void Layoutroot_loaded (object sender, RoutedEventArgs e)
{
observablecollection<musicmodel> lst = new observablecollection<musicmodel> ();
for (int i = 0; I < SC. Count; i++)
{
lst. ADD (New Musicmodel ()
{
musicname = Sc[i]. Name,
auther = Sc[i]. Artist.name,
Musicpath = Sc[i]. Tracknumber
});
}
this.lstLirics.ItemsSource = LST;
}
private void Lstlirics_selectionchanged (object sender, SelectionChangedEventArgs e)
{
mediaplayer.pause ();
frameworkdispatcher.update ();//Why do I get an error when I call this method?
Mediaplayer.play (SC, lstlirics.selectedindex);
}
}
5, SoundEffect class play sound:
String path = "Sound/knock.wav";//production operation is "content"
var soundstream= application.getresourcestream (New Uri (Path, urikind.relativeorabsolute));
SoundEffect se = Soundeffect.fromstream (soundstream.stream);
Frameworkdispatcher.update ();//Why do you want to add this sentence? Don't understand.
Se. Play ();
6, hide the top system tray, you must use this. SetValue () method setting, cannot directly assign a value to his isvisibleproperty
This. SetValue (Microsoft.Phone.Shell.SystemTray.IsVisibleProperty, false);//! (bool) this. GetValue (Microsoft.Phone.Shell.SystemTray.IsVisibleProperty)
Summary of Windows Phone 7 issues