wpf eventsetter handler binding in style

后端 未结 3 1536
刺人心
刺人心 2020-12-14 02:51

I have a style, and I want to bind a command to the EventSetter\'s Handler with RelativeSource. The command is in the viewModel.

3条回答
  •  被撕碎了的回忆
    2020-12-14 03:17

    My answer on this question does the trick without any external tool kits/libraries. However, it does not use RelativeSource, and it is not 100% MVVM. It requires one line of code in a code-behind event handler.

提交回复
热议问题