积极答复者
InvokePropertyChanged 如何去更新index绑定的变化?

问题
答案
-
InvokePropertyChanged 里面是属性名 如果是索引的话,使用下面的写法:
PropertyChanged( this, new PropertyChangedEventArgs( "Item[]" ) )
通知更新所有Item
PropertyChanged( this, new PropertyChangedEventArgs( "Item[" + index + "]" ) )
通知更新一个
不过我相信 你的 InvokePropertyChanged 是自己或者一个组件自己实现的,里面基本上是这样的:
protected void OnPropertyChanged(string name) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(name)); } }
Sincerely,
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 a013strife 2011年9月3日 2:10
全部回复
-
InvokePropertyChanged 里面是属性名 如果是索引的话,使用下面的写法:
PropertyChanged( this, new PropertyChangedEventArgs( "Item[]" ) )
通知更新所有Item
PropertyChanged( this, new PropertyChangedEventArgs( "Item[" + index + "]" ) )
通知更新一个
不过我相信 你的 InvokePropertyChanged 是自己或者一个组件自己实现的,里面基本上是这样的:
protected void OnPropertyChanged(string name) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(name)); } }
Sincerely,
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 a013strife 2011年9月3日 2:10