If i understand your question correctly, you can use Height="Auto"
for your listbox (or other controls) and if you want to keep your window's height updated according to the listbox, you can bind your windows height to the listbox with the below code:
Height="{Binding ActualHeight, ElementName=personListBoxTest}"
i hope it can be useful for you.