microsoft / microsoft-ui-xaml

WinUI: a modern UI framework with a rich set of controls and styles to build dynamic and high-performing Windows applications.
MIT License
6.38k stars 683 forks source link

Need help with ComboBox DropDown & Popup #10060

Open naumenkoff opened 1 month ago

naumenkoff commented 1 month ago

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:

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>

Image

ComboBox with overridden ComboBoxDropDownBackground

<ComboBox>
    <ComboBoxItem Content="Hello"/>
    <ComboBoxItem Content="World"/>
    <ComboBox.Resources>
        <SolidColorBrush x:Key="ComboBoxDropDownBackground" Color="{ThemeResource AcrylicInAppFillColorDefaultBrush}" />
    </ComboBox.Resources>
</ComboBox>

Image

I referred to these Issues:

Versions:

whiskhub commented 1 month ago

It's a bug in WinUI 3. Currently only in WinUI 2 (UWP) there is an acrylic background, sadly.