
Hi Friends,
Some of my properties have there "IsReadOnly" state controled by another "bool" property, and I want to control the "bool" state by pressing a button.
I want this button to be displayed inside the editor, to the right (eg. with a "PadLock" image).
What I wish is to add this button as :
- an adorner to the actual editor UI control, whatever the editor is
- a classic button added to the right of the actual editor UI control, for example within a dockpanel containing both.
To achieve case #1, I need to have somehow access to the underlying UI control created for a given editor, and then add my adorner.
But I don't know how and were to access the actual UI control after its creation and before its display ...
To achieve case #2, I've created a custom Editor whos ValueTemplate looks like :
<DockPanel
LastChildFill='True'
>
<Button
DockPanel.Dock='Right'
Margin='1'
Focusable='False'
Style='{StaticResource {x:Static themes:SharedResourceKeys.EmbeddedButtonBaseOverrideStyleKey}}'
/>
<ContentControl
Content='{Binding}'
ContentTemplate='{Binding " + $"{nameof(MyPropertyModel.LockedOriginalEditor)}.{nameof(PropertyEditor.ValueTemplate)}" + @"}'
/>
</DockPanel>
MyPropertyModel.LockedOriginalEditor is the original Editor, for example a DoublePropertyEditor.
Display is OK, but when ProperyGrid tries to bind to the underlying editor, it expects a DoublePropertyEditor but finds my custom "high level" editor instead, and many bindings fail.
Would appreciate some help on that one ;-)
[Modified 2 years ago]