public ArchivedNoteViewModel(Note note) { Note = note; name = note.Name; content = note.Content; fontFamily = FontFamilyUtil.FontFamilyFromFont(note.Metadata.FontFamily); fontSize = note.Metadata.FontSize; archivedDate = DateTimeUtil.GetRelativeDate(note.Metadata.Archived.Value); }
public NoteViewModel(Note note) { _model = note; OnEditCommand = ReactiveCommand.Create(() => EditClicked.Invoke(this, null)); OnArchiveCommand = ReactiveCommand.Create(() => ArchiveClicked.Invoke(this, null)); OnDeleteCommand = ReactiveCommand.Create(() => DeleteClicked.Invoke(this, null)); OnMiddleClickCommand = ReactiveCommand.Create(() => MiddleMouseClicked.Invoke(this, null)); name = note.Name; content = note.Content; fontFamily = FontFamilyUtil.FontFamilyFromFont(note.Metadata.FontFamily); fontSize = note.Metadata.FontSize; caretPosition = note.Metadata.CaretPosition; }