public PropertyGrid() { _properties = new PropertyItemCollection(new ObservableCollection <PropertyItem>()); EditorDefinitions = new EditorDefinitionCollection(); PropertyDefinitions = new PropertyDefinitionCollection(); AddHandler(PropertyItem.ItemSelectionChangedEvent, new RoutedEventHandler(OnItemSelectionChanged)); AddHandler(PropertyItem.ItemOrderingChangedEvent, new RoutedEventHandler(OnItemOrderingChanged)); CommandBindings.Add(new CommandBinding(PropertyGridCommands.ClearFilter, ClearFilter, CanClearFilter)); }
protected virtual void OnEditorDefinitionsChanged(EditorDefinitionCollection oldValue, EditorDefinitionCollection newValue) { if (oldValue != null) { oldValue.CollectionChanged -= new NotifyCollectionChangedEventHandler(OnEditorDefinitionsCollectionChanged); } if (newValue != null) { newValue.CollectionChanged += new NotifyCollectionChangedEventHandler(OnEditorDefinitionsCollectionChanged); } UpdateProperties(true); }