private static void CreateCollectionBinding(IOnPropertyChanged sourceObj, string path, string propToNotify) { var pcdo = new PropertyChangeDependencyObject(); var binding = new Binding(path) { Source = sourceObj }; BindingOperations.SetBinding(pcdo, PropertyChangeDependencyObject.PropertyChangeDependencyProperty, binding); BindingOperations.SetBinding(pcdo, PropertyChangeDependencyObject.CollectionChangeDependencyProperty, binding); pcdo.DependentPropertyChanged += () => sourceObj.OnPropertyChanged(propToNotify); pcdo.DependentCollectionChanged += () => sourceObj.OnPropertyChanged(propToNotify); pcdos.Add(pcdo); }
public static void PropertiesRefresh(this IOnPropertyChanged thisValue) => thisValue.OnPropertyChanged(string.Empty);