Reputation: 1887
Is there a way for me to have the Window of my WPF application resize dynamically with the content? I tried setting the width and height to auto, but no go.
Upvotes: 11
Views: 8697
Reputation: 81
Use a resizable control like Grid and put all the controls in Rows/Columns. Also set HorizontalAlignment to stretch for each control inside the Grid.
Upvotes: 1
Reputation: 50038
Set SizeToContent="WidthAndHeight" on the window and the window will dynamically resize based on its content size.
Upvotes: 18