How can I know that some property was binding?
For example a property (Class implemeted from NotificationObject):
public string Title
{
set
{
_title=value;
this.RaisePropertyChanged(() => this.Title);
}
get
{
return _title;
}
}
Using:
<TextBlock Text={Binding Title}>
I need to know when a property is not used by anyone to release dispose resources.
There’s no easy way to know if a control is bound to a specific property of your ViewModel, but you can know if someone is subscribed to the
PropertyChangedevent (just check if it’s not null). The binding engines subscribes to this event, so if something is bound to at least one property of your ViewModel, thePropertyChangedevent handler won’t be null.