C
C#16mo ago
Rushaan

Grid not resizing its child elements WPF

https://pastebin.com/MqM8XZCH As seen in the image i want the elements to proportionally adapt in size when the window is resized
No description
No description
14 Replies
SG97
SG9716mo ago
you need to stop using margins as a way of positioning controls and instead use rows/columns that adapt to the grids size
Rushaan
RushaanOP16mo ago
does that mean i need to create rows and columns for each element ?
SG97
SG9716mo ago
not necessarily
Sir Rufo
Sir Rufo16mo ago
A ViewBox may help
SG97
SG9716mo ago
for columns (to start with)
No description
SG97
SG9716mo ago
for rows (to start with)
No description
SG97
SG9716mo ago
that slider maybe needs it's own column
Rushaan
RushaanOP16mo ago
Hmm whys that, doesnt it come under row 1 column 1? Ah yes it fixed it, tysm but now im wondering why are there more ways of achieving responsive layout if viewbox does the job so easily
Sir Rufo
Sir Rufo16mo ago
It depends what you want to achieve
Rushaan
RushaanOP16mo ago
I see
Sir Rufo
Sir Rufo16mo ago
If you have a list showing 10 rows it will even show 10 rows when maximized with a viewbox
Rushaan
RushaanOP16mo ago
sooo, isnt that a good thing
Sir Rufo
Sir Rufo16mo ago
It depends
Rushaan
RushaanOP16mo ago
oo

Did you find this page helpful?