Passing event args and sender to the RelayCommand

前端 未结 3 1556
天命终不由人
天命终不由人 2020-12-18 22:39

How do you get event sender when using RelayCommand?

3条回答
  •  一整个雨季
    2020-12-18 23:44

    I was having a similar problem, but only needed to get the EventArgs. Gladly, this was absurdly simple once I found the answer in another thread here at Stack Overflow.

    
    

    Once you know about that magic "PassEventArgsToCommand" setting, you're golden. Just use a RelayCommand instead of a plain RelayCommand.

    I hope this helps.

提交回复
热议问题