【发布时间】:2014-11-30 12:38:53
【问题描述】:
我有Button,名为left_button 和ScrollViewer,名为scrollv。如何在没有代码隐藏的情况下将Button.Command 绑定到ScrollViewer.LineLeftCommand?
【问题讨论】:
-
是否要将
Button.Command和ScrollViewer.LineLeftCommand绑定到同一个ICommand? -
ScrollViewer 有一些命令,我想通过按钮单击调用它,而不需要代码隐藏。可能是我做的不对,两年多没认真工作过WPF。
-
我正在寻找
ScrollViewer.LineLeftCommand,但没有找到。你的意思是ScrollBar.LineLeftCommand?你在找吗:<Button Command="ScrollViewer.LineLeftCommand" ... /> -
哦,谢谢。与 CommandTarget={Binding ElementName=name} 一起使用,一切正常。
标签: wpf binding command action