public static void DelegatePropertyChangeFrom( this IExternalNotifyPropertyChanged target, INotifyPropertyChanged foreignObject, string foreignProperty, params string[] localProperties) { PropertyChangedEventHandler foreignObjectOnPropertyChanged = (s, e) => { if (e.PropertyName.Equals(foreignProperty, StringComparison.Ordinal)) { foreach (var localProperty in localProperties) { target.OnPropertyChanged(localProperty); } } }; foreignObject.PropertyChanged += foreignObjectOnPropertyChanged; }
public static void NotifyPropertyChange(this IExternalNotifyPropertyChanged obj, string propertyName) => obj.OnPropertyChanged(propertyName);