I noticed the Effect Property is missing in Silverlight for Windows Phone 7 so I did some googling and apperently it was dropped due to performance reasons. I basically want to do something like this
<TextBlock ...>
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
And
<Image ...>
<Image.Effect>
<DropShadowEffect/>
</Image.Effect>
</Image>
So is there some other way to get a DropShadowEffect
in Silverlight for Windows Phone 7? And are there any news if it'll be in the next release?
Thanks
With the image you can just simply create a drop shadow in Photoshop/Gimp etc (works well for me) and save it as .png.
With TextBlock it is a bit harder. For instance, create a half-transparent image with the shadow and place both TextBlock and the Image inside the Canvas. Change the Canvas.ZIndex="integer" attached property to place them in a specific order - image has to be underneath. Also shadow should be blurred.
The drawbacks are:
<TextBlock ...>
<TextBlock.RenderTransform>
<TranslateTransform X="3" Y="3" />
</TextBlock.RenderTransform>
</TextBlock>
<TextBlock ...>
</TextBlock>
I wanted a shadow effect and this worked for me. You need to put same content in both textblocks (except textblock name). X and Y are the horizonatal and vertical distance of shadow from text. You can also use negative numbers if depending on position of shadows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With