Open.Core.Helper.ListenPropertyChanged C# (CSharp) Method

ListenPropertyChanged() public static method

Casts the given object to an 'INotifyPropertyChanged' and if it is observable wires up the given event handler to the 'PropertyChanged' event.
public static ListenPropertyChanged ( object model, PropertyChangedHandler handler ) : void
model object The model to wire up.
handler PropertyChangedHandler The handler to attach.
return void
        public static void ListenPropertyChanged(object model, PropertyChangedHandler handler)
        {
            INotifyPropertyChanged observable = model as INotifyPropertyChanged;
            if (observable != null) observable.PropertyChanged += handler;
        }