Weird subject so let me explain: I have a Silverlight MainPage with a border control at the top of the page of height 400. Once the user is Authenticated, I navigate to a child page. I also collapse the border on the MainPage. The child page shows correctly but there is a blank 400 space above it where the MainPage border control was before it was collapsed. I thought Visibilty.Collapsed is supposed to surrender back the space it occupies but it doesnt seem to do this. I have set VerticalAlignment=’Top’ on the frame object in the MainPage and also tried that setting on the child page but neither work.
Anyone have any suggestions? Thanks
Code Updated:
<ScrollViewer>
<Grid x:Name="LayoutRoot"
DataContext='{StaticResource ViewModel}'>
<Grid.RowDefinitions>
<RowDefinition Height='400'></RowDefinition>
<RowDefinition Height='*'></RowDefinition>
</Grid.RowDefinitions>
You should be able to resolve this by wrapping the border in a grid and then setting the height of the RowDefinition containing the border to Auto. The following test example worked for me:
And in the code behind: