I work on a school project in WPF C# and I run into this problem. I use MVVM model for it. Because I'm a beginner in WPF and I have a strick date give this to the teacher I had to use youtube tutorials and internet forums such as this one.
My problem basicly is that I want to use one of my RelayCommand to change the current view, but not in the mainwindow, instead in one of my views. But when I wrote down the code it refuses to realise it as a RelayCommand, but it realise it as a PropertyPath. I Give the examples down below in pictures.
I tried place "invisibly" buttons to the mainWindow and fire them when i click the button that "should change" the view to another, but I can't refer to it from the view's C#. I tried to add them as datacontext with "Ctrl+." solution too, and I got a little success and it recognized it as what is it (AKA RelayCommand), but the function still didn't work.
Basicly that's what I did so far, and I asked the teacher, my classmates and every possible people but nobody had a clue why it doesn't work. Sorry if it's an obvious question, but as I mentioned I'm a beginner and because of the deadline I can't start over again, because I don't have the time for it :( Thank you for reading this "shout" for help, and THANKS in advance if you can help me :)
Have a nice day!
The original command in the MainWindow The command in the other View