public void AddNewEntry(DiaryEntry newEntry) { if (DiaryEntries == null) { DiaryEntries = new ObservableCollection <DiaryEntry>(); } DiaryEntries.Add(newEntry); }
//Creates a new Entry in the Diary with the EDITING state private void CreateEntry() { //Creates a new entry if (DiaryEntries.Count <= 50) //Diary Cover counts as diary Entry { ViewModel_DiaryPage newEntry = new ViewModel_DiaryEntry() { Entry = new DiaryEntry() { FirstSubmit = DateTime.Now }, CurrentState = ViewModel_DiaryPage.PageState.EDITING }; DiaryEntries.Add(newEntry); NewDiaryEntryAdded(this, EventArgs.Empty); } else { EntryLimitReached(this, EventArgs.Empty); } }