How do I pass the information from View to ViewModel with DelegateCommand?

前端 未结 5 1629
感情败类
感情败类 2021-02-02 18:16

In my View, I have a button.

When the user clicks this button, I want to have the ViewModel save the context of the TextBlock in the database.



        
5条回答
  •  旧时难觅i
    2021-02-02 18:44

    here is the elegant way.

    Give a name to your textbox, then bind the CommandParameter in the button to it's Text property:

    
        
        
        

提交回复
热议问题