private void SaveGrid() { TodoListClass todoListClass = new TodoListClass { Document = rich_textbox_1.Document }; data_Handler.SaveXamlObject(todoListClass, this.XamlPath); }
public void SaveXamlObject(TodoListClass obj, string XamlPath) { string xml = XamlWriter.Save(obj); try { File.WriteAllText(XamlPath, xml); } catch { //Ignored } }
public TodoListClass GetXmlObject(string XamlPath) { try { string xaml = File.ReadAllText(XamlPath); TodoListClass r = (TodoListClass)XamlReader.Parse(xaml); return(r); } catch { return(null); } }