Exemple #1
0
        private void SaveChanges()
        {
            CurrentNote.Name       = EditedNote.Name;
            CurrentNote.Text       = EditedNote.Text;
            CurrentNote.Owner      = EditedNote.Owner;
            CurrentNote.CategoryId = CurrentCategory.Id;

            _repository.UpdateNote(CurrentNote);

            ReturnToPreviousView?.Invoke(true);
        }
Exemple #2
0
        private void SaveChanges()
        {
            CurrentCategory.Name        = EditedCategory.Name;
            CurrentCategory.Description = EditedCategory.Description;
            CurrentCategory.Color       = EditedCategory.Color;

            if (EditedCategory.Notes.Count == 0)
            {
                CurrentCategory.Notes.Clear();
            }

            _repository.UpdateCategory(CurrentCategory);

            ReturnToPreviousView?.Invoke(true);
        }
Exemple #3
0
 private void CancelChanges()
 {
     ReturnToPreviousView?.Invoke(false);
 }
 private void CancelAddCategory()
 {
     NewCategory = new Category();
     ReturnToPreviousView?.Invoke(false);
 }
 private void AddCategory()
 {
     _repository.AddCategory(NewCategory);
     NewCategory = new Category();
     ReturnToPreviousView?.Invoke(true);
 }
 private void CancelAddNote()
 {
     NewNote = new Note();
     ReturnToPreviousView?.Invoke(false);
 }
 private void AddNote()
 {
     _repository.AddNote(NewNote);
     NewNote = new Note();
     ReturnToPreviousView?.Invoke(true);
 }