2012-10-29 30 views
0

我需要給出一個WPF控件的3D效果,我將在其他WPF控件中使用它。WPF中的3D邊框裝飾器

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

有沒有辦法來直接myControlScrollViewer沒有使用邊界子節點? 關於裝飾裝飾 ...什麼是最簡單的方法來做到這一點?

回答

2

你的意思是?

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

我可以有一個真正的邊界線(自定義顏色)圍繞childControl這樣嗎? – serhio

+0

對不起,我不明白你的問題。你想讓你的childWpfControl在scrollViewer的邊框內? – Bijan

+0

這個問題與這一個聯繫在一起 http://stackoverflow.com/questions/13197528/put-a-border-on-the-grid-in-wpf – serhio