I'm trying to save two lists of my custom objects the first list of type List<Vechicle>
.
XmlSerializer SerializerObjVechicle = new XmlSerializer(typeof(List<Vechicle>));
Then I get the error
"An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll"
This is my vechicle class
[Serializable]
public class Vechicle
{
private int _Id;
private String _Registration;
public Vechicle(int id,String registration)
{
Id = id;
Registration = registration;
}
public override string ToString()
{
return Id.ToString() + " " + Registration;
}
#region getters/setters
public int Id{
get { return _Id; }
set { _Id = value; }
}
public String Registration
{
get { return _Registration; }
set { _Registration = value; }
}
#endregion
}
}