I am currently trying to create a SplitView.Pane that looks kinda like the edge browser history/favourites pane. Therefore, I need a shadow at the (left) border of my SplitView.Pane.
To create the shadow, I use the DropShadowPanel from the UWP Toolkit. The idea is something like this (doesn't work, of course):
<controls:DropShadowPanel>
<SplitView.Pane>
<!--Content-->
</SplitView.Pane>
</controls:DropShadowPanel>
The shadow should be outside the panel. How do I get this done?
This is how the shadow should look like:
EDIT: The DropShadow should be OUTSIDE the pane. The duplicate-post's answer creates a shadow inside the pane. Unless i miss something there.
You can't simply apply a shadow to the
Pane's direct child as it will appear being cut off. You can of course try overriding theSplitView's style and applying the shadow directly onto thePaneelement, but you will soon find out that thePaneRoothas its own Clipping logic defined in XAML, so if you were not careful, you could potentially break its underlying UI logic.Here's a simple solution that works without modifying the style. The idea is to apply the shadow on an inner element where there's enough space between this element and the
Pane's root element for the shadow to spread out.Assume the
PanePlacementis set toRight, then your root element, aBorder(i.e.RootBorder), should have a left padding(i.e.12,0,0,0) that matches theBlurRadius(i.e.12) of theDropShadowPanel.Also, the
PaneBackgroundneeds to be transparent otherwise it will cover up the shadow. Instead, the background color should then be applied to a container element(i.e.PaneContentGrid) that's inside the root element.Please see the code below for a simple example -
XAML
Demo