3
votes

I have a Canvas inside of a Grid in a WPF app. I want to draw a skeleton in Canvas from Kinect data. But the Canvas has a tiny width, probably 1px. The Grid makes it shrink, not keeping its set Width and Height. How to make Grid keep its declared size?

1
Why don't you post the relevant XAML? - Clemens
Is the Canvas inside a grid with a row/col definition width or height set to Auto? - Andy
This question is really unclear. It needs the XAML posted so people can understand what is going on. - David Pond

1 Answers

0
votes

Make sure both the grid and the canvas have HorizontalAlignment="Stretch" and VerticalAlignment="Stretch"