public static string SerializeObject(BezierViewModel toSerialize) { try { XmlSerializer xmlSerializer = new XmlSerializer(typeof(BezierViewModel)); StringWriter textWriter = new StringWriter(); xmlSerializer.Serialize(textWriter, toSerialize); return textWriter.ToString(); } catch (System.Exception ex) { } return string.Empty; }
public void SetCurve(string sCurve) { m_Segments = BezierViewModelSerializer.DeserializeObject(sCurve); DataContext = m_Segments; }
public static BezierViewModel DeserializeObject(string toDeserialize) { BezierViewModel ret = new BezierViewModel(); try { XmlSerializer xmlSerializer = new XmlSerializer(typeof(BezierViewModel)); StringReader textReader = new StringReader(toDeserialize); ret = xmlSerializer.Deserialize(textReader) as BezierViewModel; } catch (System.Exception ex) { } return ret; }
public void SetCurve(BezierViewModel pCurve) { m_Segments = pCurve; DataContext = m_Segments; }