DialogTextBoxPropertyEditor with DisplayType=Merged

Grids for WPF Forum

Posted 8 years ago by Mary Fontana - Rudolph Technologies
I have defined properites that use
[Editor(typeof(DialogTextBoxPropertyEditor), typeof(PropertyEditor))]

To display multi-line text I would like to extend the DialogTextPropertyEditor to use the PopupButton with DisplayMode=Merged.
I did this by creating a new class and overriding ValueTemplateKey with a my new DialogTextMultiLineValueTemplateKey.

I then created an event handler for the PopupButton.PopupOpeningEvent.
What I would like to do is display the multi-line text of the selected propertyGrid item in the popupButton PopupContent.
Is there a way to get/set a parameter containing the IPropertyDataAccessor?

Thanks in advance,

[Modified at 01/07/2011 11:13 AM]

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Mary,

You could probably search up the visual tree using VisualTreeExtended.GetAncestor(popupButton, typeof(IPropertyDataAccessor)). That will find the PropertyGridDataAccessorItem for the associated property. This implements IPropertyDataAccessor and forwards all calls to the actual IPropertyDataAccessor (which is available via the DataContext property).

Other than that, you'd have to bind some property to the IPropertyDataAccessor using RelativeSource FindAncestor, such as the PopupButton.Tag property. Then you'd retrieve it from there.

Actipro Software Support

Posted 8 years ago by Mary Fontana - Rudolph Technologies
I set the PopupButton Tag property to the following and it worked.

Tag="{Binding RelativeSource={RelativeSource AncestorType={x:Type propgridPrimitives:IPropertyDataAccessor}}}"

Thanks for your help.
The latest build of this product (v2018.1 build 0675) was released 10 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.