Adding a Description Panel
One feature supplied by the Windows Forms property grid that isn’t present in the WPF Elements PropertyGrid is a description panel, showing a description of the current selected item. This step shows how to add such a panel.
To add a description panel:
- Create a TextBlock (or other text display control).
- Bind its Text property to the SelectedGridItem property of the PropertyGrid control.
- Set the Converter property of the binding to be a RowToDescriptionConverter.
You can also display the property name by binding another text element to SelectedGridItem.Node.HumanName.
See 08_AddingDescriptionPanel.xaml for an example.
The sample also illustrates why the WPF Property Grid does not contain its own description panel. Creating our own panel enables a level of customization and control which would be much more complex to achieve if the panel were buried inside the grid control. In this example, we have created an alternative display for when there is no selection, and have styled the box (e.g. rounded corners) and added additional content (the line between the property name and the description).