Can i use a property of control like button in a viewmodel, for example if i have a button that content is “Hi”, can I changing the content to “Bye” in the view model of the page?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do not use ExpandAllNodes() in your ViewModel. It is a function of the View and the ViewModel shouldn’t know about the View.
Add a property (boolean?) to the ViewModel that indicates whether or not the Tree should be expanded and bind the state of the Tree to that property.
I am not quite sure what Treeview control you are using but is you cannot bind the state of the Treeview you could have a change of the property in the ViewModel cause a method call to expand the nodes.