I'm looking for an easy way to add a Drop Shadow effect like in WPF, using XAML only. I would like to apply it for the elements in a ListView.
I haven't found anything more than experiments like this: https://blogs.windows.com/buildingapps/2016/09/12/creating-beautiful-effects-for-uwp/#BIRDSebvmJwAFY5Y.97
It seems that it would requiere a lot of code-behind. I would like to avoid it.
The drop shadow is often used for elements of a graphical user interface such as windows or menus, and for simple text. The text label for icons on desktops in many desktop environments has a drop shadow, as this effect effectively distinguishes the text from any colored background it may be in front of.
What is a drop shadow? Drop shadows give the impression that a layer in your Photoshop project is hovering and casting a shadow onto the background layer beneath it. You can apply a drop shadow to any type of Photoshop layer to help give the impression that your image exists in 3D space.
If you want to do it yourself with the Composition API, it's quite some work indeed. Luckily we got a great community, and one of those open source projects is the UWP Community Toolkit. This toolkit contains a DropShadowPanel control that does the hard work for you.
<controls:DropShadowPanel BlurRadius="4.0"
ShadowOpacity="0.70"
OffsetX="5.0"
OffsetY="5.0"
Color="Black">
<Image Width="200" Source="Unicorn.png" Stretch="Uniform"/>
</controls:DropShadowPanel>
Note that you'll have to set the app version to 10.0.14393.0 (Anniversary Update) for this effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With