[C#, XAML] How to make your XAML components fill parent cell properly? via /r/learnprogramming


[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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s