serhio
serhio

Reputation: 28586

3D border decorator in WPF

I need to give a 3D effect of a WPF control that I will use in an other WPF Control.

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

Is there a way to directly put myControl into the ScrollViewer, without using Border child node? Something about decorators and adorners... What is the simplest way to do it?

Upvotes: 0

Views: 2538

Answers (1)

Bizhan
Bizhan

Reputation: 17085

Do you mean?

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

Upvotes: 2

Related Questions