Esempio n. 1
0
        public void Add(FormDocument <TodoForm> document)
        {
            if (string.IsNullOrWhiteSpace(Item))
            {
                validationError = "PLEASE ENTER A VALUE!";
                document.Reload();
                return;
            }

            items.Add(new TodoItem(Guid.NewGuid(), IsDone, Item));
            IsDone          = false;
            Item            = string.Empty;
            validationError = null;
            document.Reload();
        }
Esempio n. 2
0
        public void ToggleDone(FormDocument <TodoForm> document, DocumentEntry entry)
        {
            var id   = Guid.Parse(entry.GetArgument("LM"));
            var item = items.Find(i => i.Id == id);

            if (item == null)
            {
                return;
            }

            item.Done = !item.Done;
            document.Reload();
        }
Esempio n. 3
0
        public void Delete(FormDocument <TodoForm> document, DocumentEntry entry)
        {
            var id   = Guid.Parse(entry.GetArgument("LM"));
            var item = items.Find(i => i.Id == id);

            if (item == null)
            {
                return;
            }

            items.Remove(item);
            document.Reload();
        }