Hello
I am making a note-taking application I already have all my notes, and notebook listed, But now I am facing this problem.
I am using the MVVM pattern, and to communicate with the other VM, I am using the messaging center, so I have zero code-behind.
Look at this VM
public NotesVM() {
CreateNewNoteCommand = new Command(async () => {
var note = await CreateNote(RecivedNotebook);
await GetNotes(RecivedNotebook);
});
SelectedNoteCommand = new Command(async () => {
await Application.Current.MainPage.Navigation.PushAsync(new EditorPage());
MessagingCenter.Send(this, "note", SelectedNote);
});
I want to navigate to the EditorPage, when the user creates a new note or when the user selects a note, the big problem is that in both scenarios I need information from the note such as the ID
I tried to subscribe to both scenarios in my EditoVM, which works, but is very messy, and have to duplicate my subscribing for both scenarios, and when debugging I get duplicates messages.
Everybody tells me to use an MVVM framework but if xamarin is MVVM out of the box, I don't see the point