[C#, XAML] How to make your XAML components fill parent cell properly?
I have a grid in which the following code is placed:
<StackPanel x:Name="CanvasStack" BorderBrush="Black" Grid.Row="4" Grid.ColumnSpan="3"> <Border x:Name="CanvasBorder" BorderBrush="Black"> <Canvas x:Name="GraphCanvas" Margin="2,2,-2,-2"/> </Border> <ScrollBar x:Name="CanvasScrollBar"/> </StackPanel>
When I deploy, however, the actual size of the canvas is 0. I read that XAML components automatically try to FILL the parent, which I want it to do, so I have not added any alignment options. The Canvas should fill the entire stackpanel – the scrollbar at the bottom. Further, the border should be there as well.
Out of all things XAML I have had the least amount of luck getting the sizing, stretching etc to work.
Thank you for your help.
Submitted July 18, 2017 at 03:25AM by NoobsDeSroobs
via reddit http://ift.tt/2vcMKNk