private void SaveGrid()
        {
            TodoListClass todoListClass = new TodoListClass
            {
                Document = rich_textbox_1.Document
            };

            data_Handler.SaveXamlObject(todoListClass, this.XamlPath);
        }
Esempio n. 2
0
        public void SaveXamlObject(TodoListClass obj, string XamlPath)
        {
            string xml = XamlWriter.Save(obj);

            try
            {
                File.WriteAllText(XamlPath, xml);
            } catch
            {
                //Ignored
            }
        }
Esempio n. 3
0
        public TodoListClass GetXmlObject(string XamlPath)
        {
            try
            {
                string xaml = File.ReadAllText(XamlPath);

                TodoListClass r = (TodoListClass)XamlReader.Parse(xaml);
                return(r);
            }
            catch
            {
                return(null);
            }
        }