我使用 EventToCommand 并希望每次触发事件时更新 CommandParameter 绑定(bind)。有什么方法可以实现吗?
最佳答案
您可以像这样使用 PassEventArgsToCommand="True"这会将值传递给 View 模型
公共(public)无效 StartOdoMeter(RoutedPropertyChangedEventArgs arg)
在 arg 中,您可以从该控件中获取值
关于.net - EventToCommand 使参数保持最新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9173018/