Friday, July 17, 2009

ZOrder (ZIndex) in Silverlight 2

The Z-Order in Silverlight is (according to a blog I read) a bit messy.

So - what you can do to set the Z-Order is to change the Canvas.ZIndexProperty. This still doesn't work though, so one guy suggests to change the Opacity directly after changing this property. In my case the original Opacity was eg. 1... then it will look like this.

(I tested it and it works for me)

iCanvas.SetValue(Canvas.ZIndexProperty, 10);
iCanvas.Opacity = 0.9;
iCanvas.Opacity = 1.0;

No comments:

Post a Comment