本文介绍了如何为SplitView.Pane添加阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为SplitView.Pane添加投影?

我尝试了UWP Community Toolkit UI控件中的DropShadowPanel,并写了这样的内容:

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>

但是,阴影希望出现在窗格内,而我希望它位于SplitView.Pane之外,并将其包裹起来.我该如何实施?谢谢!

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

推荐答案

我没有发现您具有DropShadowPanel的set属性.如果DropShadowPanel的所有属性均为默认值,则DropShadowPanel将与其他无效.您可以通过以下代码创建DropShadowPanel.这是官方代码示例您可以参考.

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>

这篇关于如何为SplitView.Pane添加阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-11 02:39