Call Command from Code Behind

前端 未结 6 1137
轻奢々
轻奢々 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:31

    You also might have embedded your code in any MessaginCenter.Subscribe and work with MessagingCenter model. If you intend only execute something from code behind instead of clicking in a view button with Command property, it worked perfectly to me.

    I hope it helps someone.

提交回复
热议问题