Ejemplo n.º 1
0
 public RichTextNoteViewModel(INotesMonitor monitor, string id, DateTime dateCreated, DateTime dateModified, string title, string rtfText)
     : base(monitor, id, dateCreated)
 {
     this.dateModified = dateModified;
     this.title        = title;
     this.rtfText      = rtfText;
     HasChanges        = false;
 }
Ejemplo n.º 2
0
        public NotesListViewModel(INotesMonitor monitor)
        {
            this.monitor     = monitor;
            viewModelFactory = new NoteViewModelFactory(monitor);

            Notes = new ObservableCollection <NoteViewModel>();

            NewRichTextNoteCommand = new RelayCommand(CreateNewRichTextNote);
            NewToDoListNoteCommand = new RelayCommand(CreateNewToDoListNote);
            RemoveNoteCommand      = new RelayCommand <NoteViewModel>(RemoveNote);
            DuplicateNoteCommand   = new RelayCommand <NoteViewModel>(DuplicateNote);

            foreach (INote noteData in monitor.GetAllNotes())
            {
                Notes.Add(viewModelFactory.CreateNoteViewModel(noteData));
            }

            monitor.NoteAdded   += MonitorNoteAdded;
            monitor.NoteDeleted += MonitorNoteDeleted;
        }
Ejemplo n.º 3
0
        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;
        }
Ejemplo n.º 4
0
 public NoteViewModelFactory(INotesMonitor monitor)
 {
     this.monitor = monitor;
 }
Ejemplo n.º 5
0
 protected NoteViewModel(INotesMonitor monitor, string id, DateTime dateCreated)
 {
     this.monitor = monitor;
     this.id      = id;
     DateCreated  = dateCreated;
 }