1 回答
TA贡献1812条经验 获得超5个赞
您为 设置事件AlphaKeys,如果集合已更改,它将引发一个事件,而不是为他的项目。
你必须INotifyPropertyChanged为你的MyCommand,
public class MyCommand : INotifyPropertyChanged
{
private string _dispalyName ;
public string DispalyName
{
get { return _dispalyName ; }
set
{
_dispalyName = value;
NotifyOfPropertyChange("DispalyName");
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyOfPropertyChange(string name)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(name));
}
}
}
- 1 回答
- 0 关注
- 256 浏览
添加回答
举报