How do you keep the WPF window sized to content with an Expander after resize

You have to make your window non-resizeable if you’re going to use SizeToContent. Also, you shouldn’t use SizeToContent=”Height”, and then set an explicit Height. Think about it – which one should WPF believe for the window height, the user’s setting or the Content? It can’t just switch back and forth between the two.

Leave a Comment