public void SaveData(string entryPath) { var path = Path.Combine(entryPath, _fileName); var data = new PathHistory(); data.Path = History.ToArray(); using (var stream = new FileStream(path, FileMode.OpenOrCreate)) { var ser = new DataContractSerializer(typeof(PathHistory)); ser.WriteObject(stream, data); } }