Skip to content

AttachedCardShadow not working on Windows 10 when Corner Radius is set on controlΒ #4331

@DominicMaas

Description

@DominicMaas

Describe the bug

I'm trying to add a shadow to an image with rounded corners. This works as expected on Windows 11, but on Windows 10 the shadow does not appear.

<Border
    Width="300"
    Height="300"
    ui:Effects.Shadow="{StaticResource ItemShadow}"
    CornerRadius="26">
    <Border.Background>
        <ImageBrush ImageSource="{x:Bind ImageLink}" Stretch="Uniform" />
    </Border.Background>
</Border>

If I remove the CornerRadius from the Border element, the shadow will appear (but the image is no longer clipped as expected).

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

  • Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)

Steps to reproduce the behavior:

See https://github.com/DominicMaas/AttachedShadowsRepro. Of concern is MainPage.xaml.

Expected behavior

The image is clipped with a clipped shadow on both Windows 10 and Windows 11.

Screenshots

Windows 11

image

Windows 10

Screenshot 2021-10-21 112729

Environment

NuGet Package(s):

  • Microsoft.NETCore.UniversalWindowsPlatform 6.2.13
  • Microsoft.Toolkit.Mvvm 7.1.1
  • Microsoft.Toolkit.Uwp.UI.Media 7.1.1

Windows 10 Build Number:

  • 21H1 (19043)

App min and target version:

  • October 2018 Update (17763)
  • May 2020 Update (19041)

Device form factor:

  • Desktop
  • Xbox
  • Surface Hub
  • IoT

Visual Studio version:

  • 2017 (15.{minor_version})
  • 2019 (16.{minor_version})
  • 2022 (17.{minor_version})

Metadata

Metadata

Assignees

No one assigned

    Labels

    WinUI πŸ’ Related to WinUI 3 Version or when paired with External can mean requires fix in WinUI 2/3.external ‴️Requires an update to an external dependency or due to code outside the Toolkit.not an issue ❌An issue that is beyond the scope of Windows Community Toolkitquestion ❔Issues or PR require more informationsdkcheck 🏁

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions