How to implement HorizontalAlignment = "Stretch" in RelativePanel when creating generic applications for Windows 10?

I know how to implement it with Grid and StackPanel, can it do without it?

+4
source share
1 answer

Of course, just align it left and right using the panel! For example:

Horizontal stretch

<RelativePanel>
    <TextBox RelativePanel.AlignLeftWithPanel="True"
             RelativePanel.AlignRightWithPanel="True" />
</RelativePanel>

If you want vertical stretching, do a similar thing, just align the top and bottom panel with the panel:

Vertical extension

<RelativePanel>
    <TextBox RelativePanel.AlignTopWithPanel="True"
             RelativePanel.AlignBottomWithPanel="True" />
</RelativePanel>
+22
source

Source: https://habr.com/ru/post/1609607/


All Articles