0
我試圖保存一個集合,在存儲診斷日誌時臨時導航離開我的應用程序 - 我看了其他示例代碼,它看起來很基本,因爲我已經下面做:使用PhoneApplicationService.Current.State保存集合
節能:
PhoneApplicationService.Current.State["DiagnosticLog"] = DiagnosticLog;
加載:
if (PhoneApplicationService.Current.State.ContainsKey("DiagnosticLog"))
DiagnosticLog = (ObservableCollection<DiagnosticLogEntry>)
PhoneApplicationService.Current.State["DiagnosticLog"];
但是我得到這個錯誤:
A first chance exception of type 'System.Runtime.Serialization.InvalidDataContractException' occurred in System.Runtime.Serialization.dll
有什麼建議嗎?
謝謝,就是這樣...只是做了一個空白的構造函數,它的工作 – Jason 2012-04-19 20:08:37