我有一個很長的列表選擇器,其中我顯示按日期排序的數據。 我現在面臨的問題是,成功的列表爲首次載入時間,但回來的頁面方含從細節頁面longlistselctor後,應用程序與以下異常崩潰: System.NullReferenceException was unhandled Message=NullReferenceException StackTrace: at Microsoft.Phone.Controls.LongListSelector.Balance() at Microsoft.Phone.Controls.LongListSelector.LongListSelector_LayoutUpdated(Object sender, EventArgs e) at System.Windows.FrameworkElement.OnLayoutUpdated(Object sender, EventArgs e) at MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)
加載時崩潰LongListSelector
我因爲這種事情發生了,他甚至無法追查。 列表填充爲:
currentAudioList = DiaryDBController.DBController.GetDiaryRecordsWithAudio();
var DiaryAudioRecordsByDate = from rec in currentAudioList
group rec by rec.CreationDate into r
orderby r.Key
select new Group<DatabaseClasses.DiaryRecord>(r.Key, r);
try
{
this.AudioGroupListSelector.ItemsSource = DiaryAudioRecordsByDate;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex);
}
任何幫助將不勝感激。 謝謝。