Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }