How to add a drop shadow for SplitView.Pane

依然范特西╮ 提交于 2019-12-12 03:33:26

问题


How to add a drop shadow for SplitView.Pane?

I tried DropShadowPanel from the UWP Community Toolkit UI Controls and wrote something like this:

<SplitView DisplayMode="Overlay" PanePlacement="Right" Grid.Column="1" HorizontalAlignment="Stretch">
    <SplitView.Pane>
        <controls:DropShadowPanel>
            <Frame Name="DetailsFrame" />
        </controls:DropShadowPanel>
     </SplitView.Pane>
 </SplitView>

However, the shadow appears inside the pane, while I want it to be outside SplitView.Pane, wrapping it. How can I implement that? Thanks!


回答1:


The DropShadowPanel Control allows the creation of a drop shadow effect for any Xaml FrameworkElement in the markup. You can control the following property of the drop shadow effect : Offset, Color, Opactity and Blur Radius.

I did not find that you have set property of the DropShadowPanel . If all the property of the DropShadowPanel are default value, the DropShadowPanel will have no effect as except. You could create DropShadowPanel by the following code. And this is official code sample you could refer to.

 <SplitView.Pane>
     <control:DropShadowPanel  BlurRadius="5" ShadowOpacity="0.5" Color="Black" OffsetX="10" OffsetY="10" VerticalAlignment="Center"
                       HorizontalAlignment="Center">
         <TextBlock Text="Pane"
        FontSize="24"
        VerticalAlignment="Center"
        HorizontalAlignment="Center" />
     </control:DropShadowPanel>
 </SplitView.Pane>


来源:https://stackoverflow.com/questions/43395093/how-to-add-a-drop-shadow-for-splitview-pane

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!