Hemant-Webo
Hemant-Webo

Reputation: 543

How to implement HorizontalAlignment="Stretch" in RelativePanel while creating Universal Windows Platforms 10 Apps?

I know how to implement it using Grid and StackPanel, can it done here without that?

Upvotes: 9

Views: 2835

Answers (1)

Igor Ralic
Igor Ralic

Reputation: 15006

Sure, just align it left and right with panel! For example:

Horizontal stretch

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

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

Vertical stretch

<RelativePanel>
    <TextBox RelativePanel.AlignTopWithPanel="True"
             RelativePanel.AlignBottomWithPanel="True" />
</RelativePanel>

Upvotes: 30

Related Questions