Open
Description
Hello everyone.
I can't figure out how the ComboBox works: for some reason, it has a gray background, and I can't get rid of it.
For example, in NavigationView
, I able to remove it by overriding NavigationViewContentBackground
to Transparent
.
But here it's a completely different situation: I've read tons of articles and looked through the code of many apps that use ComboBox
, where it is rendered properly, but I still haven't found a solution.
What I am referring to:
- In the Settings app (Windows 11),
ComboBox
has an opaque, non-gray background.
- In the MVVM Toolkit Sample App (The Final Result, SubredditWidget),
ComboBox
has a transparent blurred, non-gray background.
DropDownButton
<DropDownButton Content="Say">
<DropDownButton.Flyout>
<MenuFlyout Placement="Bottom">
<MenuFlyoutItem Text="Hello" />
<MenuFlyoutItem Text="World" />
</MenuFlyout>
</DropDownButton.Flyout>
</DropDownButton>
But for me, everything looks completely different. I don't know how this happened. And why no solutions are working!
ComboBox
It differs from DropDownButton
.
<ComboBox>
<ComboBoxItem Content="Hello"/>
<ComboBoxItem Content="World"/>
</ComboBox>
ComboBox with overridden ComboBoxDropDownBackground
<ComboBox>
<ComboBoxItem Content="Hello"/>
<ComboBoxItem Content="World"/>
<ComboBox.Resources>
<SolidColorBrush x:Key="ComboBoxDropDownBackground" Color="{ThemeResource AcrylicInAppFillColorDefaultBrush}" />
</ComboBox.Resources>
</ComboBox>
I referred to these Issues:
- ComboBox popup of items to select is translucent in 1.1.0 p3 #7176
- Acrylic does not work if mica is enabled #7200
- Menu Flyout Acrylic doens't work in Windows 11 #8396
- ShouldConstrainToRootBounds = False disables backdrop #8657
- Acrylic Brush doesn't work in combobox #9523
Versions:
- Nuget: WindowsAppSDK 1.6.240923002, Runtime: 1.6.1
- net8.0-windows10.0.26100.0
- Windows 11 Pro 26100.2033