private void HandleCreateListCommand(object parameter)
        {
            if (this.Title == null)
            {
                this.Message = "Title can not be null!";
                return;
            }

            if (this.Todos.Count == 0)
            {
                this.Message = "Todo list must contain at least one !";
                return;
            }
            var filledTodoes = this.Todos.Where(t => !string.IsNullOrEmpty(t.Text));

            if (filledTodoes.Count() == 0)
            {
                this.Message = "Todo list must contain at least one Todo!";
                return;
            }

            DataPersister.CreateNewTodosList(this.Title, filledTodoes);
            this.Title = "";
            this.Todos.Clear();
            this.TodoLists = DataPersister.GetTodoLists();
        }
Beispiel #2
0
        private void HandleCreateListCommand(object parameter)
        {
            DataPersister.CreateNewTodosList(this.Title, this.description, DateTime.Now,//this.deadline,
                                             this.price, this.category, this.totalDifficulty, this.TasksList.Where(t => !string.IsNullOrEmpty(t.Name)));
            this.Title           = "";
            this.Description     = "";
            this.Deadline        = "";
            this.price           = 0.0d;
            this.category        = "";
            this.totalDifficulty = "1";

            this.TasksList.Clear();
        }