4.5.2.2 Custom Modal Property editor
In this section we learn to customize another property editor: Modal editor, click a button in this editor to pop up a form, select data from the form, and return the value to the Properties window. The most important point is that we can customize the modal window content of this selection data more flexibly than the collection editor above. Or look at the effect chart first, as shown in Figure 4-20.
Figure 4-20 Modal Property editor
The image above is a modal selection window tailored to a property that represents the choice of food (fruit/meat/vegetables, etc.), and click Next to the property. button pops up the modal Data Selection window on the left side of the diagram.
Here's how it is implemented. The first thing to be explained is that the window that pops up here is a very common WinForm window, because the mode is called directly from the IDE's interface in design mode. Add a WinForm file CategoryWindow.cs to our control, as shown in Figure 4-21.
Figure 4-21 "Add New Item" dialog box