2013-08-06 5 views
4

내 클래스의 형식 인 개체의 컬렉션을 저장하려고합니다.Windows Phone 8 - IsolatedStorage에 목록 저장

컬렉션 데이터 계약 유형 'System.Collections.Generic.List'는 매개 변수없는 public 생성자가 없기 때문에 deserialize 할 수 없습니다. 매개 변수없는 public 생성자를 추가하면이 오류가 해결됩니다. 여기

내 클래스 :

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
namespace MojProjekt 
{ 
    class Lekarna 
    { 
     public string Ime { get; set; } 

     public Lekarna() 
     { 
     } 
    } 
} 

그리고 여기가 IsolatedStorage에 저장하는 방법입니다

List<Lekarna> lekarneList = new List<Lekarna>(); 
// here I then fill the list ... 
IsolatedStorageSettings localStorage = IsolatedStorageSettings.ApplicationSettings; 
localStorage.Add("lekarneList", lekarneList; 
localStorage.Save(); 
+0

내가 시도 공공 클래스를 만들 네가 한 것처럼 격리 된 저장소에 목록을 저장하려면 System.ArgumentException –

답변

6

public class Lekarna

+1

및 물론 속성 :) –