Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemBackdrop has no effect on Popup #10087

Open
whiskhub opened this issue Oct 18, 2024 · 0 comments
Open

SystemBackdrop has no effect on Popup #10087

whiskhub opened this issue Oct 18, 2024 · 0 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@whiskhub
Copy link

Describe the bug

Setting SystemBackdrop on Popup (e.g. to Acrylic) has no effect, the popup stays transparent.
Regardless of whether ShouldConstrainToRootBounds is set to True or False.

For a Flyout, setting SystemBackdrop works.

Steps to reproduce the bug

Add the following code to a WinUI 3 window, start the app and click the buttons.

<Grid>
    <Grid.Background>
        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
            <GradientStop Color="Yellow" Offset="0.0" x:Name="GradientStop1"/>
            <GradientStop Color="Red" Offset="0.25" x:Name="GradientStop2"/>
            <GradientStop Color="Blue" Offset="0.75" x:Name="GradientStop3"/>
            <GradientStop Color="LimeGreen" Offset="1.0" x:Name="GradientStop4"/>
        </LinearGradientBrush>
    </Grid.Background>
    
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Spacing="15">

        <Button Content="Open Flyout">
            <Button.Flyout>
                <Flyout ShouldConstrainToRootBounds="False">
                    <Flyout.FlyoutPresenterStyle>
                        <Style TargetType="FlyoutPresenter" BasedOn="{StaticResource DefaultFlyoutPresenterStyle}">
                            <Setter Property="Background" Value="Transparent" />
                        </Style>
                    </Flyout.FlyoutPresenterStyle>
                    <TextBlock Text="This is a texttttttttttttttttttt" TextWrapping="Wrap"/>
                    <Flyout.SystemBackdrop>
                        <DesktopAcrylicBackdrop/>
                    </Flyout.SystemBackdrop>
                </Flyout>
            </Button.Flyout>
        </Button>

        <Button x:Name="myButton" Click="myButton_Click">Open Popup</Button>

        <Popup x:Name="MyPopup" XamlRoot="{x:Bind myButton.XamlRoot, Mode=OneWay}" ShouldConstrainToRootBounds="False" PlacementTarget="{x:Bind myButton}" DesiredPlacement="Bottom">
            <Grid BorderBrush="Red" BorderThickness="1" MaxWidth="100" Padding="10">
                <TextBlock Text="This is a texttttttttttttttttttt" TextWrapping="Wrap"/>
            </Grid>
            <Popup.SystemBackdrop>
                <DesktopAcrylicBackdrop/>
            </Popup.SystemBackdrop>
        </Popup>
    </StackPanel>
</Grid>
private void myButton_Click(object sender, RoutedEventArgs e)
{
    MyPopup.IsOpen = !MyPopup.IsOpen;
}

Expected behavior

Popup has acrylic background if SystemBackdrop is set to DesktopAcrylicBackdrop.

Screenshots

Image

NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

@whiskhub whiskhub added the bug Something isn't working label Oct 18, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

1 participant