예제 #1
0
        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;
        }
예제 #2
0
 public static void NotifyPropertyChange(this IExternalNotifyPropertyChanged obj, string propertyName) =>
 obj.OnPropertyChanged(propertyName);