0
全部。我正在嘗試使用Visual Studio 2010開發Windows Phone 7的應用程序。它是一個應該能夠根據當前事件播放音樂的音樂播放器。玩家在應用程序中崩潰
我設法提取事件,但是當我試圖將它與玩家結合時,整個玩家就會崩潰。這裏是代碼。
void Appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
{
try
{
AppointmentResultsDataLINQ.DataContext =
from Appointment appt in e.Results
where appt.IsAllDayEvent == false
select appt;
}
catch (System.Exception)
{
//No results
}
}
private void button2_Click(object sender, RoutedEventArgs e)
{
if ((((Appointment)(AppointmentResultsDataLINQ.DataContext)).Subject).Equals("Meeting"))
{
mediaElement1.Source = new Uri("http://www.opendrive.com/files/NV8zNTMwNDYwX2hxRXZR/Crystallize.mp3", UriKind.Absolute);
}
else
{
mediaElement1.Source = new Uri("https://www.opendrive.com/files/NV8zMjAxODY0X0VBNDJY/Hetken%20tie%20on%20kevyt%20(piano%20cover)%20-%20YouTube.mp3", UriKind.Absolute);
}
mediaElement1.Play();
}
什麼是運行時異常? –
你如何檢查它?對不起,但我仍然在C#和Windows手機編程方面很新。 – user1876574
它如何崩潰?你有什麼信息? –