CVB.Net 14.0
PropertyChangeNotifier Class Reference

Helper to not root (keep alive) the target object if registering on value change events. More...

Inherits DependencyObject, and IDisposable.

Public Member Functions

 PropertyChangeNotifier (DependencyObject propertySource, string path)
 Creates the notifier from the given propertySource and its property path . More...
 
 PropertyChangeNotifier (DependencyObject propertySource, DependencyProperty property)
 Creates the notifier from the given propertySource and its property . More...
 
 PropertyChangeNotifier (DependencyObject propertySource, PropertyPath property)
 Creates the notifier from the given propertySource and its property path. More...
 
void Dispose ()
 Clears the binding.
 

Static Public Attributes

static readonly DependencyProperty ValueProperty
 Identifies the Value dependency property.
 

Properties

DependencyObject PropertySource [get]
 Gets the property source object or null if it doesn't exist.
 
object Value [get, set]
 Returns/sets the value of the property. More...
 

Events

EventHandler< PropertyValueChangedEventArgs< object > > ValueChanged
 The event to notify on registered property value change. More...
 

Detailed Description

Helper to not root (keep alive) the target object if registering on value change events.

Code is based on https://agsmith.wordpress.com/2008/04/07/propertydescriptor-addvaluechanged-alternative/.

Constructor & Destructor Documentation

◆ PropertyChangeNotifier() [1/3]

PropertyChangeNotifier ( DependencyObject  propertySource,
string  path 
)

Creates the notifier from the given propertySource and its property path .

Parameters
propertySourceObject to register event on.
pathPath to the property to get notified on.

◆ PropertyChangeNotifier() [2/3]

PropertyChangeNotifier ( DependencyObject  propertySource,
DependencyProperty  property 
)

Creates the notifier from the given propertySource and its property .

Parameters
propertySourceObject to register event on.
propertyProperty to get notified on.

◆ PropertyChangeNotifier() [3/3]

PropertyChangeNotifier ( DependencyObject  propertySource,
PropertyPath  property 
)

Creates the notifier from the given propertySource and its property path.

Parameters
propertySourceObject to register event on.
propertyProperty path to get notified on.

Property Documentation

◆ Value

object Value
getset

Returns/sets the value of the property.

See also
ValueProperty

Event Documentation

◆ ValueChanged

EventHandler<PropertyValueChangedEventArgs<object> > ValueChanged

The event to notify on registered property value change.

The sender is this object.