uwp
uwp

Reputation: 107

Adaptive TextBox Content

I am getting the content of my text box from a web rest Api (i.e by binding it to a observable collection). Now for a particular item some content is more for some it is less and I have another grid below it which have three icons in it. Now I want the textbox to be adaptive for large content in text box the icons should always be below the content.

For large content For small content

Now for small content the icons should automatically come below the text. How should I achieve it.

Upvotes: 1

Views: 145

Answers (1)

NomadHorse2
NomadHorse2

Reputation: 170

If you are asking how to dock the buttons on the bottom of the view then you can change the row heights to be something like this:

<Grid.RowDefinitions>
      <RowDefinition Height="*"/>
      <RowDefinition Height="auto"/>
</Grid.RowDefinitions>

In this layout the buttons will take only the height they need while the textblock will take the rest of the available space. Just make sure the textblock is on row 0 and the buttons are on row 1. Or adjust if you have a header (header on row 0, textblock on row 1 and buttons on row 2).

Upvotes: 1

Related Questions