Modal Editor
The ModalEditor
element allows you to edit the value of a PropertyDefinition
in a modal dialog window.
Showing the ModalEditor via the EditorTemplate of a PropertyDefinition
The PropertyDefinition exposes the EditorTemplate
property that will allow you to define a new ModalEditor instance for it. Via the SourceProperty
of the ModalEditor, you can set the property from your business object that will be used for the binding. To use your custom editor, you can utilize the Editor
property, which expects a value of the type of FrameworkElement
.
Defining the business object
Setting the ModalEditor via the EditorTemplate property
Showing the ModalEditor When Using the EditorAttribute
When using the EditorAttribute, if its EditorStyle
property is set to Modal
, a new ModalEditor element is created.
Setting the EditorStyle property to Modal
ModalEditor defined via the EditorStyle property of the EditorAttribute
Customizing the ModalEditor
To customize the ModalEditor element, you can either create a Style
that targets it or use the FieldLoaded event. You can retrieve it through the Content
property of the Field
object that is provided by the event's arguments.
Customizing the ModalEditor via a Style
Customizing the ModalEditor via the FieldLoaded event
Customized ModalEditor
Positioning the ModalEditor
The ModalEditor element provides the functionality to position the modal dialog window. To do so, you can utilize the WindowStartupLocation
, WindowTop
, and WindowLeft
properties.
In order for the
WindowTop
andWindowLeft
properties to be taken into account, theWindowStartupLocation
property has to be set toManual
.