Use the Width/Height of parent object in XAML
Is there a way to make an object use the width and height of its parent without having to manually assign the same width and height values?For instance, if you have a Canvas sized 100 x 100 and then you add a Rectangle to that Canvas, can you make the Rectangle automatically give itself the size 100 x 100?
Maybe something like:
<Canvas Width="100" Height = "100">
<Rectangle Stroke="Black" RadiusX="5" RadiusY="5" Width="*" Height="*"/>
</Canvas>
No, not in WPF/E. You will need a Grid or Flow panel that the full WPF has.
-mark
Program Manager
Microsoft
This post is provided "as-is"
Right now we do not have a concept of layout, so there isn't a way for an element to dynamically size as a percentage of its host. It will be a while before we enable this.
-mark
Program Manager
Microsoft
This post is provided "as-is"