Notes
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using Model;
7using CommunityToolkit.Mvvm.ComponentModel;
8
9namespace ViewModel
10{
11public class NoteViewModel: ObservableObject
12{
13public Note Note { get; } = new Note();
14
15public string Title
16{
17get => Note.Title;
18set
19{
20Note.Title = value;
21OnPropertyChanged();
22IsEdit = true;
23}
24}
25
26public string Text
27{
28get => Note.Text;
29set
30{
31Note.Text = value;
32OnPropertyChanged();
33IsEdit = true;
34}
35}
36
37public bool IsEdit
38{
39get => Note.IsEdit;
40set
41{
42Note.IsEdit = value;
43OnPropertyChanged();
44}
45}
46
47public int Id
48{
49get => Note.Id;
50set
51{
52OnPropertyChanged();
53IsEdit = false;
54}
55}
56
57public int AllNotesCount
58{
59get => Note.AllNotesCount;
60}
61
62public NoteViewModel()
63{
64
65}
66}
67}
68