问题
I'm developing an application for a Windows 10 Mobile device and I'm struggling to handle the styling for the ComboBox control, more specifically, the selected item's background color.
Without editing the Foreground or Background properties of the control;
How the ComboBox is displayed prior to selecting any items:
The expanded ComboBox
The ComboBox with "2" as the selected item
I can't seem to find any properties for the control such as SelectedItemBackgroundColor and changing the Foreground and Background properties doesn't affect the problem.
回答1:
If you look into the documentation, you can see the default style of ComboBoxItem uses the SystemControlHighlightListAccentLowBrush brush as the background of SelectedItem. You can redefine this resource in your app or you can copy the default Style and replace the Background brush in Selected VisualState with a custom brush.
来源:https://stackoverflow.com/questions/48702522/how-to-change-the-background-color-of-a-selected-combobox-item-uwp