public override Binding CreateChildrenDefaultBinding(PropertyItemBase propertyItem) { Binding binding = new Binding("Value"); binding.Mode = ((( PropertyItem )propertyItem).IsReadOnly) ? BindingMode.OneWay : BindingMode.TwoWay; return(binding); }
public virtual void PrepareChildrenPropertyItem(PropertyItemBase propertyItem, object item) { // Initialize the parent node propertyItem.ParentNode = PropertyContainer; PropertyGrid.RaisePreparePropertyItemEvent(( UIElement )PropertyContainer, propertyItem, item); }
private static void OnEditorChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { PropertyItemBase propertyItem = o as PropertyItemBase; if (propertyItem != null) { propertyItem.OnEditorChanged(( FrameworkElement )e.OldValue, ( FrameworkElement )e.NewValue); } }
private static void OnIsSelectedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { PropertyItemBase propertyItem = o as PropertyItemBase; if (propertyItem != null) { propertyItem.OnIsSelectedChanged(( bool )e.OldValue, ( bool )e.NewValue); } }
public override void ClearChildrenPropertyItem(PropertyItemBase propertyItem, object item) { if (propertyItem.Editor != null && ContainerHelperBase.GetIsGenerated(propertyItem.Editor)) { propertyItem.Editor = null; } base.ClearChildrenPropertyItem(propertyItem, item); }
public override object ItemFromContainer(PropertyItemBase container) { // Since this call is only used to update the PropertyGrid.SelectedProperty property, // return the PropertyName. var propertyItem = container as PropertyItem; if (propertyItem == null) { return(null); } return(propertyItem.PropertyDescriptor.Name); }
protected FrameworkElement GenerateCustomEditingElement(Type definitionKey, PropertyItemBase propertyItem) { FrameworkElement editor = null; if (PropertyContainer.EditorDefinitions != null) { // If no editor for the current type, fall back on base type editor recursively. while (editor == null && definitionKey != null) { editor = this.CreateCustomEditor(PropertyContainer.EditorDefinitions[definitionKey], propertyItem); definitionKey = definitionKey.BaseType; } } return(editor); }
protected virtual void OnSelectedPropertyItemChanged(PropertyItemBase oldValue, PropertyItemBase newValue) { if (oldValue != null) { oldValue.IsSelected = false; } if (newValue != null) { newValue.IsSelected = true; } this.SelectedProperty = (newValue != null) ? _containerHelper.ItemFromContainer(newValue) : null; RaiseEvent(new RoutedPropertyChangedEventArgs <PropertyItemBase>(oldValue, newValue, PropertyGrid.SelectedPropertyItemChangedEvent)); }
private void OnItemSelectionChanged(object sender, RoutedEventArgs args) { PropertyItemBase item = ( PropertyItemBase )args.OriginalSource; if (item.IsSelected) { SelectedPropertyItem = item; } else { if (object.ReferenceEquals(item, SelectedPropertyItem)) { SelectedPropertyItem = null; } } }
public override void PrepareChildrenPropertyItem(PropertyItemBase propertyItem, object item) { _isPreparingItemFlag = true; base.PrepareChildrenPropertyItem(propertyItem, item); if (propertyItem.Editor == null) { FrameworkElement editor = this.GenerateChildrenEditorElement(( PropertyItem )propertyItem); if (editor != null) { // Tag the editor as generated to know if we should clear it. ContainerHelperBase.SetIsGenerated(editor, true); propertyItem.Editor = editor; } } _isPreparingItemFlag = false; }
protected virtual FrameworkElement GenerateEditingElement(PropertyItemBase propertyItem) { return(null); }
private void RaiseClearPropertyItemEvent(PropertyItemBase propertyItem, object item) { this.RaiseEvent(new PropertyItemEventArgs(PropertyItemsControl.ClearPropertyItemEvent, this, propertyItem, item)); }
public virtual void ClearChildrenPropertyItem(PropertyItemBase propertyItem, object item) { propertyItem.ParentNode = null; PropertyGrid.RaiseClearPropertyItemEvent(( UIElement )PropertyContainer, propertyItem, item); }
protected FrameworkElement GenerateCustomEditingElement(Type definitionKey, PropertyItemBase propertyItem) { return((PropertyContainer.EditorDefinitions != null) ? this.CreateCustomEditor(PropertyContainer.EditorDefinitions.GetRecursiveBaseTypes(definitionKey), propertyItem) : null); }
protected FrameworkElement GenerateCustomEditingElement(object definitionKey, PropertyItemBase propertyItem) { return((PropertyContainer.EditorDefinitions != null) ? this.CreateCustomEditor(PropertyContainer.EditorDefinitions[definitionKey], propertyItem) : null); }
internal static void RaiseClearPropertyItemEvent(UIElement source, PropertyItemBase propertyItem, object item) { source.RaiseEvent(new PropertyItemEventArgs(PropertyGrid.ClearPropertyItemEvent, source, propertyItem, item)); }
public PropertyItemEventArgs(RoutedEvent routedEvent, object source, PropertyItemBase propertyItem, object item) : base(routedEvent, source) { this.PropertyItem = propertyItem; this.Item = item; }
protected override sealed FrameworkElement GenerateEditingElement(PropertyItemBase propertyItem) { return((this.EditingTemplate != null) ? this.EditingTemplate.LoadContent() as FrameworkElement : null); }
internal FrameworkElement GenerateEditingElementInternal(PropertyItemBase propertyItem) { return(this.GenerateEditingElement(propertyItem)); }
public abstract Binding CreateChildrenDefaultBinding(PropertyItemBase propertyItem);
public abstract object ItemFromContainer(PropertyItemBase container);
protected FrameworkElement CreateCustomEditor(EditorDefinitionBase customEditor, PropertyItemBase propertyItem) { return((customEditor != null) ? customEditor.GenerateEditingElementInternal(propertyItem) : null); }