first commit i guess

This commit is contained in:
Krzysztof KrzysiekSiemv Smaga
2025-03-26 01:01:06 +01:00
commit 321b6a07df
1973 changed files with 119622 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Input;
using NoteApp.Model;
using NoteApp.Service;
using NoteApp.View;
public class MainViewModel : INotifyPropertyChanged {
private readonly FileService _fileService;
private readonly INavigation _navigation;
public ObservableCollection<Note> Notes { get; set; } = [];
public ICommand LoadNoteCmd {get;}
public MainViewModel(FileService fileService, INavigation navigation){
_fileService = fileService;
_navigation = navigation;
LoadNotes().Wait();
LoadNoteCmd = new Command<Note>(async (note) => await LoadNote(note));
}
private async Task LoadNotes(){
Notes = await _fileService.LoadNotes();
}
private async Task LoadNote(Note note){
await _navigation.PushAsync(new NotePage(note));
}
public event PropertyChangedEventHandler? PropertyChanged;
}