Ejemplo n.º 1
0
        public async Task RefreshTodos()
        {
            var todos = await _service.ReadAll();

            if (todos == null)
            {
                _notifier.ShowError("Server returned a null list of todos");
                return;
            }
            var observableTodoItems = todos.Select(x => new ObservableTodoItem(x)).OrderByDescending(x => x.ModifiedAt);

            TodoItems       = new ObservableCollection <ObservableTodoItem>(observableTodoItems);
            StatisticsLabel = string.Format("Tasks added since app start: {0}", _service.GetTasksCreatedCount());
        }