コード例 #1
0
        private void nt_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (!PropertyGrid.PropertyDescriptors.Any(c => c.Name == e.PropertyName))
            {
                return;
            }

            var broadcast = false;

            if (Application.Current.Dispatcher.CheckAccess())
            {
                broadcast = PropertyGrid.BroadcastPropertyChanged;
            }
            else
            {
                Application.Current.Dispatcher.Invoke(
                    new Action(() => broadcast = PropertyGrid.BroadcastPropertyChanged));
            }

            if (broadcast)
            {
                tq.Do(go => { PostPropertyValueChangedAsync(e.PropertyName, false); });
            }

            if (e.PropertyName != Name)
            {
                return;
            }

            var val = Object.GetPropertyValue(e.PropertyName);

            //if (object.Equals(val, Value))
            //    return;

            _value = val;
            NotifyPropertyChanged("Value");
        }