How do I use INotifyPropertyChanged to update an array binding?

前端 未结 4 1436
再見小時候
再見小時候 2021-02-04 08:04

Let\'s say I have a class:

class Foo
{
  public string Bar
  {
    get { ... }
  }

  public string this[int index]
  {
    get { ... }
  }
}

I

4条回答
  •  执念已碎
    2021-02-04 08:28

    PropertyChanged( this, new PropertyChangedEventArgs( "Item[]" ) )
    

    for all indexes and

    PropertyChanged( this, new PropertyChangedEventArgs( "Item[" + index + "]" ) )
    

    for a single item

    greetings, jerod

提交回复
热议问题