MVVM: How to debug Commands in the ViewModel

I could swear that worked before but today I pressed a Button firing a command to the ViewModel`s RelayCommand and the code execution did not stop where I put my breakpoint.

How can I retrieve values from controls like the selectemItems bound to my ViewModel and debug them when I can not jump into the ViewModel during debugging?
MSFanboyAsked:
Who is Participating?
 
Gautham JanardhanCommented:
put a break point in the CreateSchool methos that methos will be invoked when you click on the button. Not the AddSchoolclassCommand Property. AddSchoolclassCommand will be hit only once when the binding is don
0
 
SriVaddadiCommented:
If you have ViewModel and View as two separate projects then Mark both the projects as start up projects. If you have both of them in the same project then try rebuilding the solution and it should work.
0
 
MSFanboyAuthor Commented:
rebuilding does/did not help.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
SriVaddadiCommented:
Could you post the snippet
0
 
SiliconXPCommented:
check the spellings of you commands in the xaml.
0
 
MSFanboyAuthor Commented:
there is no binding error in the output console window so the Command binding must work.

When the programm starts up it his the AddSchoolclassComand one time. But when I press the addSchoolclass button nothing happens although I have a breakpoint in the AddSchoolclassCommand ???

Maybe I think that in past that was possible hit button and debug command, but maybe I am wrong...


public RelayCommand AddSchoolclassCommand
        {
            get
            {
                return _addSchoolclassCommand ?? (_addSchoolclassCommand = new RelayCommand
                (
                    () => CreateSchoolclass(),
                    () => CanCreateSchoolclass)
                );
            }
        }

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.