What is IPropertyDataAccessor?

Grids for WPF Forum

Posted 9 years ago by Chris Carter
Version: 14.2.0611
Avatar

The CustomPropertyEditor QuickStart uses this pattern liberally:

{Binding Value, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}, [...]}

When I try to look this interface up in the documentation or the forums, I don't see any particulars. For example:

  • Which elements should I expect to implement this interface?
  • What does the interface represent? Or what does it mean to add and remove properties of a parent?

Also, AddChild "gets a value indicating whether a new child can be added to an associated collection/parent." Its signature is:

void AddChild()

How is that getting anything? How would a child be added? Is this interface so internal I shouldn't even care?

Comments (3)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

This low-level interface is what effectively wraps property data that comes from data factories, such as from .NET reflection or type descriptors, and gives access to the current value.  We have pre-built classes that implement it and in general, unless you are making a custom factory (which most customers never need to do), you don't need to worry about it.  Custom property editors will want to use the bindings like what you posted to access the value.

The doc comment on AddChild was a copy/paste error and we'll fix it for the next version.  Thanks.


Actipro Software Support

Posted 9 years ago by Chris Carter
Avatar

So which element should I expect to be selected by {RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}} ? Which elements implement that interface?

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

They are various types in the Primitives namespace that are used in different scenarios (normal property, collection property, etc.).  But the real data type really doesn't matter.  It's just the interface that matters for purposes of the property editors.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.