locked
Blend 3 Effects/Drop Shadow RRS feed

  • Question

  • Hi, I was wondering if it was possible to apply, or at least toggle the drop shadow effect that is available in Blend, by setting events in the C# code behind. I need to toggle this effects based upon some events in the code behind. I know how to do these types of things through control templates, but this is not what I am trying to do. I NEED to do this through the C#. Is this possible? Thanks!
    Wednesday, October 14, 2009 12:58 PM

All replies

  • There's a really easy workaround for this. Assuming you're using a grid for layout, put a copy of your control with the drop shadow applied in the same cell as the original and collapse it. Whenever you want the drop shadow, toggle the visibility to visible and ta-da, you have a drop shadow.

    If you know the size and shape of what you're going to be adding a drop shadow too, it's even easier and you can gain some performance as well. Instead of duping the control, just make a drop shadow in photoshop and save it out as a png with transparency. On mouseover (or whatever), toggle it to visible. I used this trick with a fly-out menu, and the png made what was extremely choppy animation buttery-smooth.


    www.LeonTerry.com
    • Proposed as answer by VLTII Thursday, October 15, 2009 7:05 PM
    Thursday, October 15, 2009 7:04 PM