Stretching a control to fill a Silverlight Canvas

Posted by skb on Stack Overflow See other posts from Stack Overflow or by skb
Published on 2010-05-23T20:05:40Z Indexed on 2010/05/23 20:11 UTC
Read the original article Hit count: 210

Filed under:

I have a canvas like this:

<Canvas>
    <Rectangle Fill="Blue" Opacity="0.5" Canvas.ZIndex="1" />
    <Grid Canvas.ZIndex="0" >
            ...bla bla bla...
    </Grid>
</Canvas>

I need the Width/Height of the Canvas to just stretch to the Width/Height of the Grid, but then I need the Width/Height of the Rectangle to stretch to match. Is this possible? How do I do it?

© Stack Overflow or respective owner

Related posts about silverlight-3.0