我想使用MetroEventToCommand库来绑定一个事件。 http://metroeventtocommand.codeplex.com/MetroEventToCommand的CommandParameter不能与控件一起使用(Windows通用10)
它调用该方法,但它不提供控件作为参数。据说它是空的。
这就是我所拥有的。
<ScrollViewer x:Name="test">
<ListView/>
<metroEventToCommand:EventToCommandManager.Collection>
<metroEventToCommand:EventToCommand Command="{Binding RefreshCommand}" Event="ViewChanging" CommandParameter="{Binding ElementName=test, Mode=TwoWay}"/>
</metroEventToCommand:EventToCommandManager.Collection>
</ScrollViewer>
public RelayCommand<ScrollViewer> RefreshCommand { get; set; }
private void init()
{
RefreshCommand = new RelayCommand<ScrollViewer>(Refresh);
}
private void Refresh(ScrollViewer o)
{
if (o != null)
{
}
}
在此先感谢。
我会尝试将RelayCommand更改为RelayCommand
已经尝试过,它没有工作。 – denderp