Effects (DropShadowEffect) in Windows Phone 7

I noticed that Silverlight for Windows Phone 7 lacks the Effect property, so I did a few searches, and it may have been disabled 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 any other way to get DropShadowEffect in Silverlight for Windows Phone 7? And is there any news if they are in the next issue?

thanks

+6
c # windows-phone-7 silverlight xaml effects
source share
2 answers

Using an image, you can simply create a shadow in Photoshop / Gimp, etc. (works well for me) and save it as .png.

With TextBlock, this is a little trickier. For example, create a translucent image with a shadow and place both TextBlock and Image inside the Canvas. Change the attached property Canvas.ZIndex = "integer" to place them in a specific order - the image should be at the bottom. Also, the shadow should be blurry.

Disadvantages:

  • The shadow is static.
  • Actually the UX metro does not fit.
+8
source share
 <TextBlock ...> <TextBlock.RenderTransform> <TranslateTransform X="3" Y="3" /> </TextBlock.RenderTransform> </TextBlock> <TextBlock ...> </TextBlock> 

I need a shadow effect, and it worked for me. You need to place the same content in both text blocks (except the name of the text block). X and Y are the horizontal and vertical distance of the shadow from the text. You can also use negative numbers if they depend on the position of the shadows.

+5
source share

All Articles