c# - PropertyChangedEventHandler usage question -
i have event, propertychangedeventhandler
, raise this:
propertychanged(this, new propertychangedeventargs("logfile")); propertychanged(this, new propertychangedeventargs("nodes"));
i attached it:
propertychanged += updatecamxwindowevent;
how can execute updatecamxwindowevent
when event raised "logfile"
?
what should change in code?
there no way execute specific method parameters, unless created event. should change updatecamxwindowevent
, when parameter logfile
.
if can't or logically doesn't make sense in application, can add handler tests argument , if matches, calls method:
propertychanged += (s, e) => { if (e.propertyname == "logfile") updatecamxwindowevent(s,e); };
note wouldn't able unsubscribe anonymous method event. if need that, use normal method same functionality.
Comments
Post a Comment