Ny way to do a Drop Shadow effect in XAML on a TextBlock

formattingxaml

I have a XAML TextBlock that I would like to render as a drop shadow. That is a white layer of text on top of a black layer. I'm doing this to make the text stand. Currently I have two TextBlocks offset to the right and below by two pixels. The top layer is white and the bottom layer is black.

Is there a simple way to do this in XAML? If so can you please provide an example?

Best Answer

Bitmap effects are deprecated. Use the new GPU-accelerated DropShadowEffect instead.

<TextBlock>
    <TextBlock.Effect>
        <DropShadowEffect />
    </TextBlock.Effect>
    Drop.
</TextBlock>
Related Topic