.net Silverlight-单击复选框时不执行命令
我的xaml中也有一个复选框.net Silverlight-单击复选框时不执行命令,.net,vb.net,silverlight-4.0,.net,Vb.net,Silverlight 4.0,我的xaml中也有一个复选框 <CheckBox Grid.Row="1" Command="{Binding ShowCancelledPropertiesCommand}" HorizontalAlignment="Right" Margin="0,6,160,0"/> 我不明白为什么没有触发该命令?我会对复选框的IsChecked属性进行双向绑定 IsChecked="{Binding somePropertyInViewModel, Mode=TwoWay} 在viewm
<CheckBox Grid.Row="1" Command="{Binding ShowCancelledPropertiesCommand}" HorizontalAlignment="Right" Margin="0,6,160,0"/>
我不明白为什么没有触发该命令?我会对复选框的IsChecked属性进行双向绑定
IsChecked="{Binding somePropertyInViewModel, Mode=TwoWay}
在viewmodel中,在属性中加入一些逻辑
public bool somePropertyInViewModel
{
get { ... }
set { ... }
}
你能展示更多你的代码吗?例如,视图模型是否实现INotifyPropertyChanged?如果没有,则何时设置ShowCancelledPropertiesCommand属性值?
public bool somePropertyInViewModel
{
get { ... }
set { ... }
}