我正在尝试在WPF中绑定一个命令,但它没有命中。 XAML中还有其他控件具有绑定功能,一切正常。无法弄清楚我错过了什么..请帮忙
<Button Grid.Row="2" Grid.ColumnSpan="2" Name="btnStart" Content="Start Getting Data" Margin="78.4,6.4,0,0" Grid.Column="1" Command="{Binding StartPolling}" />
<Label Grid.Row="2" Grid.Column="4" Content="{Binding Path=LastRefreshed}"></Label>
public ICommand StartPolling
{
get
{
_startPolling = new RelayCommand(
param => StartPollingWell());
} return _startPolling;
}
}