microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.34k stars 677 forks source link

Need help with ComboBox DropDown & Popup #10060

Open naumenkoff opened 1 week ago

naumenkoff commented 1 week 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 week ago

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