Catel.Data.ChangeNotificationWrapper.ChangeNotificationWrapper C# (CSharp) Method

ChangeNotificationWrapper() public method

Initializes a new instance of the ChangeNotificationWrapper class.
The is null or whitespace.
public ChangeNotificationWrapper ( object value ) : System
value object The value.
return System
        public ChangeNotificationWrapper(object value)
        {
            Argument.IsNotNull("value", value);

            _weakReference = new WeakReference(value);

            // Note that we either support collections OR property changed, not both because ObservableCollection implements
            // the PropertyChanged as protected.
            var valueAsNotifyCollectionChanged = value as INotifyCollectionChanged;
            if (valueAsNotifyCollectionChanged != null)
            {
                SupportsNotifyCollectionChanged = true;
            }

            var valueAsNotifyPropertyChanged = value as INotifyPropertyChanged;
            if (valueAsNotifyPropertyChanged != null)
            {
                SupportsNotifyPropertyChanged = true;
            }

            SubscribeNotifyChangedEvents(value, null);
        }
        #endregion