-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNote.cs
More file actions
36 lines (29 loc) · 1.11 KB
/
Copy pathNote.cs
File metadata and controls
36 lines (29 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace AppleNotesWpf;
public class Note : INotifyPropertyChanged
{
private string _title = "New Note";
private string _preview = "No additional text";
public string Id { get; set; } = Guid.NewGuid().ToString();
public string Title
{
get => _title;
set { if (_title != value) { _title = value; OnPropertyChanged(); } }
}
public string Preview
{
get => _preview;
set { if (_preview != value) { _preview = value; OnPropertyChanged(); } }
}
public string Content { get; set; } = "";
public string FolderName { get; set; } = "";
public DateTime LastModified { get; set; } = DateTime.Now;
public string DisplayDate => LastModified.Date == DateTime.Now.Date ? LastModified.ToString("t") : LastModified.ToString("d");
public event PropertyChangedEventHandler? PropertyChanged;
protected virtual void OnPropertyChanged([CallerMemberName] string? name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}