I am developing a Windows 8.1 Application.
I have a SettingsFlyout (msdn link if you don't know what it is) The Content of the SettingsFlyout is a grid with a ListView and a Button
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="15*" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<ListView>
<!-- SOME CONTENT -->
</ListView>
<Button Grid.Row="1" Content="Add" />
</Grid>
As per the above grid arrangement, even if the ListView's content is huge the button will be displayed properly. This is because the ListView is allowed to take maximum of 15/16 space of the grid and the rest 1/6 will always be given to the button.
However if the ListView doesn't have any content or if the content is very less, now the ListView will be collapsed completely or will have a height far lesser than 15* of the Grid and hence the button will go and sit at the top, instead of sitting at the bottom 1* only.
I want the button to stick to the bottom of the page independent of the ListView's content. That is independent of whether the ListView consumes the entire space given by the Grid or not.
So I tried the following
<RowDefinition Height="930" />
<RowDefinition Height="*" />
I basically have fixed the height of the first row in the grid to 930 so the button is forced to go down. But this is causing a problem on tablets with lower form factor. 930 is too much and the button goes out of the display. So I am stuck.
I have also tried this
<RowDefinition />
<RowDefinition Height="Auto" />
in the hope that the button will be fixed at the bottom and the rest will be given to the ListView.
Here's the image that shows the problem (You can't see the bottom border, trust me the bottom of the grid is way down than where the button is currently seen)
Can I achieve this without a code behind? I am flexible to use a different control/child if necessary. I would be very glad if someone can point me in the right direction. Thanks in Advance.