Skip to content

ControlExtensions.SelectedItemTemplate method (1 of 2)

Sets the template that presents the selected item in the header. Without it the header falls back to the item template, then to the item text.

public static ComboBox SelectedItemTemplate(this ComboBox comboBox, IDataTemplate template)
parameter description
comboBox Target combo box.
template Selected item template.

The combo box for chaining.

Sets: ComboBox.SelectedItemTemplate


ControlExtensions.SelectedItemTemplate<TItem> method (2 of 2)

Section titled “ControlExtensions.SelectedItemTemplate<TItem> method (2 of 2)”

Sets the selected item template using delegate-based templating.

public static ComboBox SelectedItemTemplate<TItem>(this ComboBox comboBox,
Func<TemplateContext, FrameworkElement> build,
Action<FrameworkElement, TItem, int, TemplateContext> bind,
Action<FrameworkElement, TItem, int, TemplateContext>? unbind = null)
parameter description
TItem Item type.
comboBox Target combo box.
build Template build callback.
bind Template bind callback.
unbind Optional template cleanup callback.

The combo box for chaining.