public RelayCommandSubscription( IMvxCommand command, INotifyPropertyChanged propertyChanged, Expression <Func <object> >[] properties ) { if (command == null) { throw new ArgumentNullException(nameof(command)); } if (propertyChanged == null) { throw new ArgumentNullException(nameof(propertyChanged)); } if (properties == null) { throw new ArgumentNullException(nameof(properties)); } _commandReference = new WeakReference <IMvxCommand>(command); _subscription = propertyChanged.WeakSubscribe(OnPropertyChanged, properties); }
public MvxPropertyChangedListener(INotifyPropertyChanged notificationObject) { if (notificationObject == null) { throw new ArgumentNullException("notificationObject"); } _notificationObject = notificationObject; _token = _notificationObject.WeakSubscribe(NotificationObjectOnPropertyChanged); }
public static WeakPropertyChangedSubscription WeakSubscribe <T>(this INotifyPropertyChanged source, Expression <Func <T> > property, EventHandler <PropertyChangedEventArgs> target) { return(source.WeakSubscribe((property.Body as MemberExpression).Member.Name, target)); }
public static WeakPropertyChangedSubscription WeakSubscribe(this INotifyPropertyChanged source, EventHandler <PropertyChangedEventArgs> target) { return(source.WeakSubscribe(null, target)); }