

Gridded image code#
This is the code I was using for the top picture, I took out the DockPanel, and switched it to a 3-column grid.įor the bottom picture, I just manually set the height on the image so it matched up with the size of the 'labels' grid - which is what I am trying to make so that if I change the font size of the labels, or the number of rows - the image will automatically Well, on my main form I have a StackPanel that will contain a bunch of these user controls - so I was just showing you what I was ending up with. The default is true and so was the Grid since it is the last child always filling the space. I set the DockPanel to LastChildFill = false. Heres where im currently at (which really screws up, unless I set the maxwidth or maxheight on the image) I bound the height of right most grid with all the labels and bound it to image height. I placed border with different border color to show you that image and grid have the same size. Ok now I understand what you looking for. Right now I have a dockpanel with an image docked to the left, and the grid fills the remaining space. Not sure if I need to put a grid inside of a grid, or some other layout. Grid contents - # of rows, font size, etc). And then have the user control matchĪny thoughts on what my layout should look like to accomplish this? I've tried all sorts of combinations of width, heights, alignments, etc, but cant seem to get the image to resize correctly so that it matches the height of the grid (based on

If the grid is 75 tall, I want the image to be 37x75, etc. If my image is 50 wide x 100 tall, and the grid is sized to be 50 tall.I ultimately want the image to be 'stretched' down to 25x50 to match the grid. Of the image, rather than the size of the grid (the picture is currently taller than the grid). I have it kind of working - but the issue is that the control seems to always resize the height of the control based on the size The control will resize correctly with just the grid, but once I add the image on the left hand side, things stop working. I want the control to automatically resize so that it is tall enough to contain the contents of the table (a grid panel with 2 columns, Im trying to create a WPF UserControl that contains an image docked to the left side, and a 2 column table on the right.
