CommunityToolkit / WindowsCommunityToolkit

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.
https://docs.microsoft.com/windows/communitytoolkit/
Other
5.88k stars 1.38k forks source link

AttachedCardShadow not working with corner radius #4420

Open Naveen61097 opened 2 years ago

Naveen61097 commented 2 years ago

Describe the bug

AttachedCardShadow not working with corner radius if the container contains any element.

image

image

Steps to Reproduce

Expected behavior

shadow should be applied in the stackpanel even if there is a corner radius.

Environment

NuGet Package(s): CommunityToolkit.WinUI.UI.Media

Package Version(s): 7.1.2

Windows 10 Build Number:

App min and target version:

Device form factor:

Visual Studio version:

ghost commented 2 years ago

Hello Naveen61097, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

AbdAlghaniAlbiek commented 2 years ago

@Naveen61097 May your problem the same as described here #4331

Naveen61097 commented 2 years ago

I don’t think so. In my case the shadow is not working in windows 11 too.

michael-hawker commented 2 years ago

Thanks @AbdAlghaniAlbiek, I agree it should be basically the same issue.

@Naveen61097 see my comment here, this is also called out in our sample app. Adding a CornerRadius to a panel changes its clipping behavior when there's content, so you need to nest an element. This generally isn't a problem with any templated control when applying a card shadow, but if you're adding it to a general panel yourself then you need to do this extra bit of work.