【问题标题】:3D border decorator in WPFWPF中的3D边框装饰器
【发布时间】:2012-10-18 20:42:07
【问题描述】:

我需要提供一个 WPF 控件的 3D 效果,我将在其他 WPF 控件中使用它。

<UserControl>
    <ScrollViewer>
        <Border BorderThickness="0">
            <Border.Effect>
                <DropShadowEffect Color="Black"
                                  ShadowDepth="3"
                                  Direction="270" />
            </Border.Effect>
            <my:MyChildWpfControl x:Name="myControl"/>
        </Border>
    </ScrollViewer>
</UserControl>

有没有办法直接myControl放入ScrollViewer不使用Border child节点? 关于 decoratorsadorners... 最简单的方法是什么?

【问题讨论】:

    标签: c# .net wpf vb.net decorator


    【解决方案1】:

    你的意思是?

    <UserControl>
        <ScrollViewer>
            <my:MyChildWpfControl>
                <my:MyChildWpfControl.BitmapEffect>
                    <DropShadowEffect Color="Black"
                                      ShadowDepth="3"
                                      Direction="270" />
                </my:MyChildWpfControl.BitmapEffect>
            </my:MyChildWpfControl>
        </ScrollViewer>
    </UserControl>
    

    【讨论】:

    • 我可以像这样在 childControl 周围设置一个真正的边框线(自定义颜色)吗?
    • 对不起,我不明白你的问题。你想让你的 childWpfControl 在 scrollViewer 内的边框内吗?
    猜你喜欢
    • 1970-01-01
    • 2013-06-29
    • 2013-02-06
    • 2016-11-24
    • 1970-01-01
    • 2010-11-25
    • 2010-11-24
    • 2015-03-04
    • 1970-01-01
    相关资源
    最近更新 更多