using NotesDataAnalyst.NoteContent; namespace NotesDataAnalyst { public partial class App : Application { public static List AllNotes { get; set; } = new List(); public static DatabaseContext Database { get; private set; } public App() { InitializeComponent(); string dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "notes.db"); Database = new DatabaseContext(dbPath); MainPage = new AppShell(); } // Метод для добавления или сохранения заметки public static void SaveNote(Note note) { var existingNote = AllNotes.FirstOrDefault(n => n.Id == note.Id); if (existingNote == null) { AllNotes.Add(note); } else { // Обновляем существующую заметку existingNote.Title = note.Title; existingNote.Text = note.Text; } } } }