c# - How to bind to all elements in a BindingList? -


i have bindinglist consisting of objects of class implements inotifypropertychanged.

public myclass : inotifypropertychanged {     // ... }  var element1 = new myclass(); var element2 = new myclass(); var mybindinglist = new bindinglist<myclass> {element1, element2}; 

i'd notified every time 1 of elements in list changed , run method. how can bind elements in list?

i have solved following way:

foreach (myclass myclass in mybindinglist) {     myclass.propertychanged += myclassonpropertychanged; }  private void myclassonpropertychanged(object sender, propertychangedeventargs propertychangedeventargs) {     // ... } 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -