Basic Library for WPF and Silverlight | ComponentOne
WPF and Silverlight Edition Basic Library / Combo Box / ComboBox Features / ComboBox Appearance / Templates
In This Topic
    Templates
    In This Topic

    One of the main advantages to using a WPF control is that controls are "lookless" with a fully customizable user interface. Just as you design your own user interface (UI), or look and feel, for WPF applications, you can provide your own UI for data managed by ComboBox for WPF. Extensible Application Markup Language (XAML), an XML-based declarative language, offers a simple approach to designing your UI without having to write code.

    You can access templates in Microsoft Expression Blend:

    1. Select the C1ComboBox control
    2. In the menu, select Edit Template.
    3. Select Edit a Copy to create an editable copy of the current template or select Create Empty to create a new blank template.

    If you want to edit the C1ComboBoxItem template, simply

    1. Select the C1ComboBoxItem and.
    2. In the menu, select Edit Template.
    3. Select Edit a Copy to create an editable copy of the current template or Create Empty, to create a new blank template.
    If you create a new template through the menu, the template will automatically be linked to that template's property. If you manually create a template in XAML you will have to link the appropriate template property to the template you've created.

    In addition to the default templates, the C1ComboBox control includes a few additional templates. These additional templates can also be accessed in Microsoft Expression Blend.

    1. Select the C1ComboBox control.
    2. In the menu, select Edit Additional Templates.
    3. Choose a template, and select Create Empty.

    ComboBox for Silverlight's combo box control is an ItemsControls that serves as a container for other elements. As such, the control includes templates to customize items places within the combo box. These templates include an ItemTemplate, an ItemsPanel, and an ItemContainerStyle template. You use the ItemTemplate to specify the visualization of the data objects, the ItemsPanel to define the panel that controls the layout of items, and the ItemStyleContainer to set the style of all container items.

    You can access these templates in Microsoft Expression Blend by selecting the C1ComboBox control and, in the menu, selecting Edit Additional Templates. Choose Edit Generated Items (ItemTemplate), Edit Layout of Items (ItemsPanel), or Edit Generated Item Container (ItemStyleContainer) and select Create Empty to create a new blank template or Edit a Copy.

    A dialog box will appear allowing you to name the template and determine where to define the template.