Beispiel #1
0
        public PropertyGrid()
        {
            _propertyDefinitionsListener = new WeakEventListener <NotifyCollectionChangedEventArgs>(this.OnPropertyDefinitionsCollectionChanged);
            _editorDefinitionsListener   = new WeakEventListener <NotifyCollectionChangedEventArgs>(this.OnEditorDefinitionsCollectionChanged);
            UpdateContainerHelper();
            EditorDefinitions   = new EditorDefinitionCollection();
            PropertyDefinitions = new PropertyDefinitionCollection();

            AddHandler(PropertyItemBase.ItemSelectionChangedEvent, new RoutedEventHandler(OnItemSelectionChanged));
            AddHandler(PropertyItemsControl.PreparePropertyItemEvent, new PropertyItemEventHandler(OnPreparePropertyItemInternal));
            AddHandler(PropertyItemsControl.ClearPropertyItemEvent, new PropertyItemEventHandler(OnClearPropertyItemInternal));
            CommandBindings.Add(new CommandBinding(PropertyGridCommands.ClearFilter, ClearFilter, CanClearFilter));
        }
Beispiel #2
0
        protected virtual void OnEditorDefinitionsChanged(EditorDefinitionCollection oldValue, EditorDefinitionCollection newValue)
        {
            if (oldValue != null)
            {
                CollectionChangedEventManager.RemoveListener(oldValue, _editorDefinitionsListener);
            }

            if (newValue != null)
            {
                CollectionChangedEventManager.AddListener(newValue, _editorDefinitionsListener);
            }

            this.Notify(this.PropertyChanged, () => this.EditorDefinitions);
        }
    public PropertyGrid()
    {
      _propertyDefinitionsListener = new WeakEventListener<NotifyCollectionChangedEventArgs>( this.OnPropertyDefinitionsCollectionChanged );
      _editorDefinitionsListener = new WeakEventListener<NotifyCollectionChangedEventArgs>( this.OnEditorDefinitionsCollectionChanged);     
      UpdateContainerHelper();
      EditorDefinitions = new EditorDefinitionCollection();
      PropertyDefinitions = new PropertyDefinitionCollection();      

      AddHandler( PropertyItemBase.ItemSelectionChangedEvent, new RoutedEventHandler( OnItemSelectionChanged ) );
      AddHandler( PropertyItemsControl.PreparePropertyItemEvent, new PropertyItemEventHandler( OnPreparePropertyItemInternal ) );
      AddHandler( PropertyItemsControl.ClearPropertyItemEvent, new PropertyItemEventHandler( OnClearPropertyItemInternal ) );
      CommandBindings.Add( new CommandBinding( PropertyGridCommands.ClearFilter, ClearFilter, CanClearFilter ) );
    }
    protected virtual void OnEditorDefinitionsChanged( EditorDefinitionCollection oldValue, EditorDefinitionCollection newValue )
    {
      if( oldValue != null )
        CollectionChangedEventManager.RemoveListener( oldValue, _editorDefinitionsListener );

      if( newValue != null )
        CollectionChangedEventManager.AddListener( newValue, _editorDefinitionsListener );

      this.Notify( this.PropertyChanged, () => this.EditorDefinitions );
    }
 public PropertyGrid()
 {
   EditorDefinitions = new EditorDefinitionCollection();
   PropertyDefinitions = new PropertyDefinitionCollection();
   CommandBindings.Add( new CommandBinding( PropertyGridCommands.ClearFilter, ClearFilter, CanClearFilter ) );
 }