CommunityToolkit / CommunityToolkit/Windows
AttachedDropShadow casts wrong shadow on different scale screens
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 1.1k
- Forks
- 166
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Describe the bug
I have noticed that the AttachedDropShadow (from CommunityToolkit.Uwp.Extensions) messes up the shadow rendering when we combine different screen scalings with different scaled assets (scale-100, scale-125, ...).
This is how the shadow looks on my 100% scaled screen. It loads the scale-100 image.
This is what happens when I move the window to my surface laptop studio screen. It loads the scale-150 image and the shadow gets messed up.
In general, the moving from one screen to the other is to illustrate that the shadow does work at first and then gets messed up.
If you open the Window in the high scale screen, the shadow is messed up anyways, it doesn't need to be moved.
I am not sure if the cause is the screen scale or the PPI/DPI, I am no expert in this matter.
Steps to reproduce
See below, as this is not a RichEditTextBox
Expected behavior
[!IMPORTANT]
Make sure you have 2 monitors with different scales connected to your machine
- Open Solution
- Run Project
- Move Window from scale screen to scale screen
- See the wrong shadow
Expected behavior
The correct shadow as is when there is only one monitor attached, or when only one asset scaling is present.
Screenshots
No response
Code Platform
- UWP
- WinAppSDK / WinUI 3
- Web Assembly (WASM)
- Android
- iOS
- MacOS
- Linux / GTK
Windows Build Number
- Windows 10 1809 (Build 17763)
- Windows 10 1903 (Build 18362)
- Windows 10 1909 (Build 18363)
- Windows 10 2004 (Build 19041)
- Windows 10 20H2 (Build 19042)
- Windows 10 21H1 (Build 19043)
- Windows 10 21H2 (Build 19044)
- Windows 10 22H2 (Build 19045)
- Windows 11 21H2 (Build 22000)
- Other (specify)
Other Windows Build number
No response
App minimum and target SDK version
- Windows 10, version 1809 (Build 17763)
- Windows 10, version 1903 (Build 18362)
- Windows 10, version 1909 (Build 18363)
- Windows 10, version 2004 (Build 19041)
- Windows 10, version 2104 (Build 20348)
- Windows 11, version 22H2 (Build 22000)
- Other (specify)
Other SDK version
No response
Visual Studio Version
No response
Visual Studio Build Number
February 2026 (18.3.2)
Device form factor
Desktop
Additional context
That's the code, for quick reference
<Grid Width="1000" Height="1000"
Background="White">
<Border x:Name="ShadowTarget"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
<Image Width="300" Height="300"
Source="/Assets/Images/FolderImage.png">
<ui:Effects.Shadow>
<ui:AttachedDropShadow CastTo="{x:Bind ShadowTarget}"
BlurRadius="20"
Offset="0" Color="#00ff00"/>
</ui:Effects.Shadow>
</Image>
</Grid>
Help us help you
Yes, but only if others can assist.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem AttachedDropShadow in CommunityToolkit.Uwp.Extensions und reproduziere das Problem mithilfe von AttachedDropShadowRepo.zip auf Monitoren mit unterschiedlicher Skalierung. Vergleiche das Verhalten beim Öffnen oder Verschieben des Fensters zwischen Bildschirmen; abgeschlossen ist die Aufgabe, wenn der Schatten mit Assets für scale-100 und scale-150 korrekt gerendert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- desktop, frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100