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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
SriVaddadiCommented:
Could you post the snippet
0
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.