async Task ExecuteRefreshCommand() { if (IsBusy) { return; } IsBusy = true; try { var todos = await azureService.GetToDos(); ToDoItems.Clear(); foreach (var todo in todos) { ToDoItems.Add(todo); } } catch (Exception ex) { Acr.UserDialogs.UserDialogs.Instance.ShowError(ex.Message); } finally { IsBusy = false; } }
private void AddToDoItem() { ToDoItems.Add(new ToDoItemViewModel { Text = "[Add text]" }); HasChanges = true; }
public void AddValue(string value) { if (string.IsNullOrWhiteSpace(value)) { return; } ToDoItems.Add(value); }
public void UpdateItem(ToDoItemViewModel toDo) { var temp = ToDoItems.FirstOrDefault(a => a.item.UserId == toDo.UserId); ToDoItems.Add(new ToDoToServer { item = temp.item, MessageType = MessageType.UpDate }); JSONWorker.Add(ToDoItems); }
public void Add(string text) { ToDoItems.Add(new ToDoItem() { Id = mTopId, Content = new StringReactiveProperty(text), Completed = new BoolReactiveProperty(false) }); mTopId++; }
private async Task AddToDoItemAsync() { var viewModel = new ToDoItemDetailViewModel(new ToDoItemViewModel(), _toDoService, _pageService); viewModel.ToDoItemAdded += (source, item) => { ToDoItems.Add(new ToDoItemViewModel(item)); }; await _pageService.PushAsync(new ToDoItemDetailPage(viewModel)); }
internal void PopulateDatabase() { if (!ToDoItems.Any()) { ToDoItems.Add(new ToDoItem { Text = "First ToDo" }); ToDoItems.Add(new ToDoItem { Text = "Second ToDo" }); ToDoItems.Add(new ToDoItem { Text = "Third ToDo" }); SaveChanges(); } }
private async Task LoadDataAsync() { if (_isDataLoaded && !_isRefreshing) { return; } _isDataLoaded = true; List <ToDoItem> toDoItems = await _toDoService.GetAllToDoItemsAsync(); ToDoItems.Clear(); foreach (var item in toDoItems) { ToDoItems.Add(new ToDoItemViewModel(item)); } }
public ToDoNoteViewModel( INotesMonitor monitor, string id, DateTime dateCreated, DateTime dateModified, string title, IEnumerable <ToDoItemViewModel> items) : base(monitor, id, dateCreated) { this.dateModified = dateModified; this.title = title; AddToDoCommand = new RelayCommand(AddToDoItem); RemoveSelectedToDoCommand = new RelayCommand <ToDoItemViewModel>(RemoveToDoItem); foreach (var item in items) { ToDoItems.Add(item); } HasChanges = false; }
public void AddTodoItem(ToDoItem item) { ToDoItems.Add(ToDoItem); ToDoItem = new ToDoItem(); }
private void AddItem() { var todo = new ToDoItem(NewToDoText, false); ToDoItems.Add(todo); }
private void AddItem() { ToDoItems.Add(new ToDoItem(NewToDoText, false)); }