2013-03-19 10 views
8

Ho progettato un'interfaccia in HTML e desidero tradurlo in WPF ma ho problemi con l'ombra inserita.Come ottenere l'effetto ombreggiatura inserto in WPF

box-shadow: inset 0 2px 7px 0 rgba(0, 0, 0, 0.5); 

L'effetto im cercando è qui, in questo jsFiddle, come posso tradurre questo in WPF esattamente?

Aggiornamento

Quello che ho attualmente in base a Richards risposta è al di sotto, la sua ancora non mostrando un'ombra però?

<Border Grid.Row="1" CornerRadius="3" Grid.Column="0" Margin="13,0,12,0" BorderThickness="0" BorderBrush="#d2d2d2" ClipToBounds="True" Background="#fff0f0f0" > 
    <Border Background="Transparent" BorderBrush="Black" CornerRadius="3" BorderThickness="0" Margin="0"> 
     <Border.Effect> 
      <DropShadowEffect ShadowDepth="2" BlurRadius="7" Color="Black" Direction="270" Opacity="0.5"/> 
     </Border.Effect> 
    </Border> 
</Border> 
+0

non Vuol WPF utilizzare la modalità di compatibilità IE7 per il rendering? IE7 non supporta box-shadow –

risposta

15

Si potrebbe provare qualcosa di simile, modificando gli spessori di conseguenza:

<Border Background="LightGray" BorderBrush="DarkGray" 
      BorderThickness="1" ClipToBounds="True"> 
    <Border Background="Transparent" BorderBrush="Black" 
       BorderThickness="0 2 7 0" Margin="-2"> 
    <Border.Effect> 
     <DropShadowEffect ShadowDepth="0" BlurRadius="10"/> 
    </Border.Effect> 
    </Border> 
</Border>