Call Command from Code Behind

前端 未结 6 1134
轻奢々
轻奢々 2020-12-23 19:03

So I\'ve been searching around and cannot find out exactly how to do this. I\'m creating a user control using MVVM and would like to run a command on the \'Loaded\' event.

6条回答
  •  别那么骄傲
    2020-12-23 19:25

    Hi to call a command in code behind you can use this code line

    e.g.: Call a Button command

    Button.Command?.Execute(Button.CommandParameter);
    

提交回复
热议问题