Shadow Effect and DropShadowBitmapEffect

image_pdfimage_print


   
 

<Window x:Class="BitmapEffectsExample"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Bitmap Effects" Height="500" Width="400">
    <!-- : -->
    <StackPanel Margin="5,20,5,5" Grid.Column="1" Grid.Row="1">
      <Button Content="A Shadow Button" Width="150" Height="30"
        Margin="5">
        <Button.BitmapEffect>
          <DropShadowBitmapEffect ShadowDepth="10"
            Color="DarkRed" />
        </Button.BitmapEffect>
      </Button>
      <TextBlock Text="Shadow" Margin="3,0,3,13" FontSize="40"
        FontWeight="Bold" Foreground="LightCoral">
        <TextBlock.BitmapEffect>
          <DropShadowBitmapEffect ShadowDepth="20"
            Color="Gray" Softness="0" />
        </TextBlock.BitmapEffect>
      </TextBlock>
    </StackPanel>

</Window>