Code: Select all
<ComboBox>
<ComboBox.Template>
<ControlTemplate
TargetType="ComboBox">
<TextBlock
Text="Hello" />
</ControlTemplate>
</ComboBox.Template>
</ComboBox>
Here's what I'm ultimately TRYING to do (based on http://www.eidias.com/Blog/2012/2/20/customizing-wpf-combo-box-style)
(The article uses Template.Triggers and Style.Triggers that will need to be replaced with VisualStates to function completely, since Triggers are not yet supported in CSHTML5)
Code: Select all
<ComboBox>
<ComboBox.Template>
<ControlTemplate
TargetType="ComboBox">
<Grid>
<ToggleButton
Name="ToggleButton"
Template="{StaticResource CBCustomToggleButton}" />
<ContentPresenter
Name="ContentSite"
Content="{TemplateBinding ComboBox.SelectionBoxItem}"
ContentTemplate="{TemplateBinding ComboBox.SelectionBoxItemTemplate}" />
<TextBox
x:Name="PART_EditableTextBox"
Foreground="{TemplateBinding Foreground}"
IsReadOnly="{TemplateBinding IsReadOnly}"
Visibility="Collapsed" />
<Popup
Name="PART_Popup"
IsOpen="{TemplateBinding ComboBox.IsDropDownOpen}">
<Grid
Name="DropDown"
MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"
MaxHeight="{TemplateBinding ComboBox.MaxDropDownHeight}">
<Border
Name="DropDownBorder"
Background="{TemplateBinding ComboBox.Background}">
<ScrollViewer
Margin="4,6,4,6">
<ItemsPresenter />
</ScrollViewer>
</Border>
</Grid>
</Popup>
</Grid>
</ControlTemplate>
</ComboBox.Template>
</ComboBox>
Help?