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

No DropShadowPanel alternative when targeting latest LTSC (17763). #4324

Open pfresnay opened 3 years ago

pfresnay commented 3 years ago

Describe the bug

AttachedDropShadow and AttachedCardShadow use CompositionVisualSurface that is only available starting with Build 18362. DropShadowPanel is marked as deprecated and there isn't any alternative when targeting 17763 witch is the latest LTSC windows 10 edition.

Steps to Reproduce

  1. Create a new UWP app that use DropShadowPanel
  2. Build
  3. See warning CS0618 is compiler logs

Steps to reproduce the behavior:

Expected behavior

  1. Make sure that DropShadowPanel will not be removed while there isn't any real alternative on latest LTSC (17763)
  2. A DropShadowPanel alternative on 17763 :-)

Environment

Package Version(s): 7.1

Windows 10 Build Number:

App min and target version:

Device form factor:

Visual Studio version:

Additional context

ghost commented 3 years ago

Hello pfresnay, 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 🙌

michael-hawker commented 3 years ago

@pfresnay as long as you don't try and round the corners of the shadow on 17763, it should work just the same as DropShadowPanel does:

https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/72ab567a06b986e615b67289cc303fcad64f4d71/Microsoft.Toolkit.Uwp.UI/Shadows/AttachedDropShadow.cs#L279

It just uses CompositionVisualSurface for better performance to make a rounded rectangle shadow when not masking (which isn't the default behavior).

pfresnay commented 3 years ago

@michael-hawker thanks for feedback! Great news if AttachedDropShadow can work on 17763. Maybe compiler can only warn when using CornerRadius?