I figured out a way to do this without having to re-template the ComboBox:
<ComboBox HorizontalContentAlignment="Center">
<ComboBox.ItemContainerStyle>
<Style TargetType="ComboBoxItem">
<Style.Triggers>
<DataTrigger Binding="{Binding Visibility, RelativeSource={RelativeSource AncestorType=ComboBox}}" Value="Visible">
<Setter Property="HorizontalContentAlignment" Value="Left"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ComboBox.ItemContainerStyle>
</ComboBox>
<ComboBox HorizontalContentAlignment="Center">
will set all items to be centered by default- the ones in the drop down list, and the one that's in the selection box.
The DataTrigger
in the ComboBoxItem
style looks for a ComboBox
parent somewhere in the visual tree. Since the drop down list is inside a Popup
, which is not part of the main visual tree, this DataTrigger
will always fail for non-selected items. The selected item is shown inside the ComboBox
as part of the main visual tree, so the DataTrigger
for that one item succeeds, and that one item gets aligned Left
.
The Visibility
part is somewhat arbitrary. I needed some property that I could predict the value of, so the DataTrigger
would always activate if the Combobox
source was found. In this case, Visibility
won't necessarily always be Visible
, but when it isn't, you can't see the alignment anyway, so it doesn't matter.