public static perRelayCommandAsync ObservesInternalProperty(this perRelayCommandAsync command, INotifyPropertyChanged source, string propertyName) { source.PropertyChanged += (s, e) => { if (string.Equals(e.PropertyName, propertyName, StringComparison.InvariantCultureIgnoreCase)) { command.RaiseCanExecuteChanged(); } }; return(command); }
public static perRelayCommandAsync ObservesCollection(this perRelayCommandAsync command, INotifyCollectionChanged collection) { collection.CollectionChanged += (s, e) => command.RaiseCanExecuteChanged(); return(command); }