コード例 #1
0
        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);
        }
コード例 #2
0
 public static void PropertiesRefresh(this IOnPropertyChanged thisValue)
 => thisValue.OnPropertyChanged(string.Empty);