C
C#6mo 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
SG976mo 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.
Rushaan.6mo ago
does that mean i need to create rows and columns for each element ?
SG97
SG976mo ago
not necessarily
Sir Rufo
Sir Rufo6mo ago
A ViewBox may help
SG97
SG976mo ago
for columns (to start with)
No description
SG97
SG976mo ago
for rows (to start with)
No description
SG97
SG976mo ago
that slider maybe needs it's own column
Rushaan.
Rushaan.6mo 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 Rufo6mo ago
It depends what you want to achieve
Rushaan.
Rushaan.6mo ago
I see
Sir Rufo
Sir Rufo6mo ago
If you have a list showing 10 rows it will even show 10 rows when maximized with a viewbox
Rushaan.
Rushaan.6mo ago
sooo, isnt that a good thing
Sir Rufo
Sir Rufo6mo ago
It depends
Rushaan.
Rushaan.6mo ago
oo