How to create a drop shadow effect for the button in UWP
<p>Code that creates drop shadow for the element:</p>
<pre><code>var compositor = ElementCompositionPreview.GetElementVisual(this.btn).Compositor;
var spriteVisual = compositor.CreateSpriteVisual();
spriteVisual.Size = new Vector2((float)btn.ActualWidth, (float)btn.ActualHeight);
var dropShadow = compositor.CreateDropShadow();
dropShadow.Offset = new Vector3(10, 10, 0);
dropShadow.Color = Colors.Orange;
spriteVisual.Shadow = dropShadow;
ElementCompositionPreview.SetElementChildVisual(this.btn, spriteVisual);
</code></pre>
<p>But shadow overlaps button. How to make shadow not to overlap button?
<img src="https://i.stack.imgur.com/C5laW.png" alt="Button" /></p>