In the next sections, we discuss these designer classes and
how they support templates and data binding.
564 CHAPTER 11 ?– DESIGN-TIME SU PPORT
The Templated Control Designer
Earlier in this chapter, we covered the various services that a design-time environment such
as Visual Studio can implement via interfaces to enhance the developer experience and
reduce development time. One of these services is template editing by implementing the
ITemplateEditingService service. We take advantage of this service to build a templated
control designer.
The templated control TemplateMenu supports Header, Separator, and Footer templates.
Although these templates can be manually edited by clicking the HTML tab in the Visual Studio
Designer, it is also possible to provide a drag-and-drop UI editing interface for template editing,
and that is what the TemplateMenuDesigner implements for the TemplateMenu control. Figure 11-8
shows the editing interface for TemplateMenu.
Figure 11-8. The menu interface for TemplateMenu control template editing
Figure 11-9 shows the editing UI for the Separator template after the developer/user clicks
the action arrow at the upper right-hand corner of the control and selects Edit Templates on
the TemplateMenu control.
Pages:
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739